generated from finsweet/developer-starter
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiled the library to .js + separate .d.ts declaration files
- Loading branch information
1 parent
46b502b
commit b669c51
Showing
121 changed files
with
860 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Import ESBuild | ||
import esbuild from 'esbuild'; | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config({ path: '.env' }); | ||
|
||
const production = process.env.NODE_ENV === 'production'; | ||
|
||
/** | ||
* Default Settings | ||
* @type {esbuild.BuildOptions} | ||
*/ | ||
const defaultSettings = { | ||
bundle: true, | ||
minify: production, | ||
sourcemap: false, | ||
outdir: production ? 'dist' : process.env.CUSTOM_BUILD_DIRECTORY || '', | ||
target: production ? 'es6' : 'esnext', | ||
}; | ||
|
||
// Files building | ||
esbuild.buildSync({ | ||
...defaultSettings, | ||
entryPoints: ['src/index.ts'], | ||
format: 'esm', | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const fadeIn: (element: HTMLElement, display?: string) => Promise<void>; | ||
export declare const fadeOut: (element: HTMLElement) => Promise<void>; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export declare class CopyJSONButton { | ||
private readonly element; | ||
private readonly hiddenTrigger; | ||
private readonly successCSSClass?; | ||
private readonly textNode; | ||
private copyData; | ||
private successText; | ||
private errorText; | ||
private notificationDuration; | ||
private notificationActive; | ||
private originalText; | ||
constructor({ element, copyData, successText, errorText, notificationDuration, successCSSClass, }: { | ||
element: HTMLElement; | ||
copyData: Record<string, unknown>; | ||
successText?: string; | ||
errorText?: string; | ||
notificationDuration?: number; | ||
successCSSClass?: string; | ||
}); | ||
private init; | ||
private createHiddenTrigger; | ||
private handleClick; | ||
private handleCopy; | ||
private triggerNotification; | ||
updateCopyData(newCopyData: Record<string, unknown>): void; | ||
updateTextContent(newText: string): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export declare class Debug { | ||
private static alertsActivated; | ||
static activateAlerts(): void; | ||
static alert(text: string, type: 'info'): void; | ||
static alert<T>(text: string, type: 'error'): T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { InteractionParams } from './Interaction'; | ||
export interface DisplayControllerParams { | ||
element: HTMLElement | string; | ||
interaction?: InteractionParams; | ||
displayProperty?: typeof DisplayController['displayProperties'][number]; | ||
noTransition?: boolean; | ||
startsHidden?: boolean; | ||
} | ||
export declare class DisplayController { | ||
private readonly interaction; | ||
private readonly noTransition; | ||
private readonly displayProperty; | ||
private visible; | ||
readonly element: HTMLElement; | ||
static readonly displayProperties: readonly ["block", "flex", "grid", "inline-block", "inline"]; | ||
constructor({ element, interaction, displayProperty, noTransition, startsHidden }: DisplayControllerParams); | ||
isVisible: () => boolean; | ||
show(): Promise<void>; | ||
hide(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface InteractionParams { | ||
element: HTMLElement | string; | ||
duration?: number | Partial<Interaction['duration']>; | ||
} | ||
export declare class Interaction { | ||
private readonly element; | ||
private active; | ||
private running; | ||
private runningPromise?; | ||
readonly duration: { | ||
first: number; | ||
second: number; | ||
}; | ||
constructor({ element, duration }: InteractionParams); | ||
trigger(click?: 'first' | 'second'): Promise<boolean>; | ||
isActive: () => boolean; | ||
isRunning: () => boolean; | ||
untilFinished: () => Promise<unknown> | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export declare class WritableStore<T> { | ||
private value; | ||
private subscribeCallbacks; | ||
constructor(value: T); | ||
get(): T; | ||
set(newValue: T): void; | ||
update(callback: (value: T) => T): void; | ||
subscribe(callback: (value: T) => void): () => void; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { simulateEvent } from './simulateEvent'; | ||
import type { FormField } from '../types'; | ||
export declare const clearFormField: (field: FormField, omitEvents?: Parameters<typeof simulateEvent>['1']) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const cloneNode: <T extends Node>(node: T, deep?: boolean) => T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function extractCommaSeparatedValues(string: string | null | undefined, compareSource?: undefined, defaultValue?: undefined, filterEmpty?: boolean): string[]; | ||
export declare function extractCommaSeparatedValues<SourceKey extends string, DefaultKey extends SourceKey>(string: string | null | undefined, compareSource: readonly SourceKey[], defaultValue?: DefaultKey | undefined, filterEmpty?: boolean): SourceKey[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const extractNumberSuffix: (string: string) => number | undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const findTextNode: (element: HTMLElement) => ChildNode | undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const getAllParents: (element: Element) => HTMLElement[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const getDistanceFromTop: (element: Element) => number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import type { FormField } from '../types/FormField'; | ||
export declare const getFormFieldValue: (input: FormField) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const getHiddenParent: (element: HTMLElement) => HTMLElement | undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import type { Entry } from '../types/Entry'; | ||
export declare const getObjectEntries: <T extends Readonly<Record<string, unknown>>>(object: T) => Entry<T>[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const getObjectKeys: <T extends Record<string, unknown>>(object: T) => (keyof T)[]; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const isScrollable: (element: Element) => boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const isVisible: (element: HTMLElement) => boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import type { Instance } from '../types/Instance'; | ||
export declare const queryElement: <T extends Element>(selector: string, instance: Instance<T>, scope?: ParentNode) => T | undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const removeChildElements: (element: Element, selector?: string | undefined) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const removeSpaces: (string: string) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const removeTrailingSlash: (value: string) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const sameValues: (array1: unknown[], array2: unknown[]) => boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const selectInputElement: (element: HTMLInputElement, select?: boolean) => string | boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import type { FormField } from '..'; | ||
export declare const setFormFieldValue: (element: FormField, value: string | boolean) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const simulateEvent: (target: EventTarget, events: keyof DocumentEventMap | Array<keyof DocumentEventMap>) => boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const throwError: <T>(message: string) => T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const wait: (time: number) => Promise<unknown>; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import type { FormField } from '../types/FormField'; | ||
export declare const isFormField: (element: Element | EventTarget | null) => element is FormField; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const isKeyOf: <T extends string>(key: string | null | undefined, source: readonly T[]) => key is T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const isNotEmpty: <T>(value: T | null | undefined) => value is T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare type Entry<T> = { | ||
[K in keyof T]: [K, T[K]]; | ||
}[keyof T]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type FormField = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare type Instance<T> = { | ||
new (): T; | ||
prototype: T; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type MapEntries<MapToConvert> = MapToConvert extends Map<infer Key, infer Value> ? [Key, Value][] : never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type PartialExcept<Original, Keys extends keyof Original> = Partial<Omit<Original, Keys>> & Required<Pick<Original, Keys>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type PickPartial<Original, Keys extends keyof Original> = Omit<Original, Keys> & Partial<Pick<Original, Keys>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type PickRequired<Original, Keys extends keyof Original> = Omit<Original, Keys> & Required<Pick<Original, Keys>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type RequiredExcept<Original, Keys extends keyof Original> = Required<Omit<Original, Keys>> & Partial<Pick<Original, Keys>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare type UnionToIntersection<Union> = (Union extends unknown ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never; |
File renamed without changes.
Oops, something went wrong.