mirror of
https://github.com/archtechx/alpine-typescript.git
synced 2025-12-12 06:44:03 +00:00
Add type Alpine
The type may be helpful when building plugins in Typescript & just using `window.Alpine` in general
This commit is contained in:
parent
a86672aad6
commit
3cf5e84efc
1 changed files with 22 additions and 0 deletions
22
src/index.ts
22
src/index.ts
|
|
@ -24,6 +24,28 @@ export abstract class AlpineComponent {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
export declare type Alpine = {
|
||||
version: string;
|
||||
pauseMutationObserver: boolean;
|
||||
magicProperties: { [name: string]: function };
|
||||
ignoreFocusedForValueBinding: boolean;
|
||||
pauseMutationObserver: boolean;
|
||||
onComponentInitializeds: Array<any>;
|
||||
onBeforeComponentInitializeds: Array<any>;
|
||||
onComponentInitializeds: (callback: function) => void;
|
||||
onBeforeComponentInitializeds: (callback: function) => void;
|
||||
listenForNewUninitializedComponentsAtRunTime: () => undefined;
|
||||
discoverUninitializedComponents: (
|
||||
callback: (rootEl: HTMLElement) => void,
|
||||
el?: HTMLElement = null
|
||||
) => void;
|
||||
discoverComponents: (callback: (rootEl: HTMLElement) => void) => void;
|
||||
start: () => void;
|
||||
addMagicProperty(name: string, callback: ($el: HTMLElement) => void);
|
||||
clone: (component: any, newEl: HTMLElement) => void;
|
||||
};
|
||||
|
||||
|
||||
export function registerComponents(components: { [name: string]: Function }): { [name: string]: ComponentConstructor } {
|
||||
Object.entries(components).forEach(([name, file]) => {
|
||||
component(name, file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue