-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[create-pull-request] update tsc build dist files
- Loading branch information
1 parent
85a8bc7
commit 173a3db
Showing
10 changed files
with
278 additions
and
0 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,6 @@ | ||
export { type KnownClassConstructor, type KnownConstructor, type AlpineComponentConstructor, type AlpineDataContext, type AlpineData, AlpineComponent } from './src/Component'; | ||
export { type ComponentList, ComponentStore, transformToAlpineData, makeAlpineConstructor } from './src/Store'; | ||
export * as Globals from './src/Global'; | ||
export { AlpineComponents, componentsPlugin } from './src/Plugin'; | ||
import { componentsPlugin } from './src/Plugin'; | ||
export default componentsPlugin; |
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,19 @@ | ||
export type KnownClassConstructor<T extends AlpineComponent> = new (...args: any[]) => T; | ||
export type KnownGenericConstructor<T> = (...args: any[]) => T; | ||
export type KnownConstructor<T> = KnownGenericConstructor<T> | KnownClassConstructor<T>; | ||
export type AlpineComponentConstructor = (...args: any[]) => any; | ||
export declare interface AlpineDataContext { | ||
init?(): void; | ||
[stateKey: string]: any; | ||
} | ||
export declare type AlpineData = AlpineDataContext | string | number | boolean; | ||
export declare abstract class AlpineComponent<T = object> implements AlpineDataContext { | ||
$data: T; | ||
$el: HTMLElement; | ||
$refs: Record<string, HTMLElement>; | ||
$store: AlpineData; | ||
$dispatch: (event: string, data?: any) => void; | ||
$id: (name: string, key?: number | string) => string; | ||
$nextTick: (callback?: () => void) => Promise<void>; | ||
$watch: <K extends keyof T | string, V extends (K extends keyof T ? T[K] : any)>(property: K, callback: (newValue: V, oldValue: V) => void) => void; | ||
} |
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,15 @@ | ||
import type { Alpine as AlpineType } from 'alpinejs'; | ||
import type { ComponentStore } from "./Store"; | ||
import type { AlpineComponentConstructor } from "./Component"; | ||
export declare interface AlpineComponentMixins { | ||
Components: ComponentStore; | ||
component: (name: string) => AlpineComponentConstructor; | ||
} | ||
export declare type AlpineWithComponents = AlpineType & AlpineComponentMixins; | ||
export declare type Alpine = AlpineType | AlpineWithComponents; | ||
declare global { | ||
interface Window { | ||
Alpine: Alpine; | ||
AlpineComponents: ComponentStore; | ||
} | ||
} |
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,12 @@ | ||
import type * as Globals from './Global'; | ||
import { type ComponentList } from "./Store"; | ||
export declare namespace AlpineComponents { | ||
interface Options { | ||
components: ComponentList; | ||
startAlpine: boolean; | ||
logErrors: boolean; | ||
} | ||
const defaultOptions: Options; | ||
function bootstrap(options?: Partial<Options>, alpine?: Globals.Alpine): void; | ||
} | ||
export declare function componentsPlugin(alpine: Globals.Alpine): void; |
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,24 @@ | ||
import type * as Impl from "./Component"; | ||
import type * as Globals from './Global'; | ||
import { AlpineComponent } from "./Component"; | ||
export type ComponentList = { | ||
[name: string]: Impl.KnownConstructor<any>; | ||
}; | ||
export declare class ComponentStore { | ||
private alpine; | ||
private logErrors; | ||
private initialized; | ||
private components; | ||
constructor(alpine: Globals.Alpine, components?: ComponentList, logErrors?: boolean); | ||
private init; | ||
component(name: string): Impl.AlpineComponentConstructor; | ||
registerAll(components: ComponentList): void; | ||
register<T>(name: string, component: Impl.KnownConstructor<T>): void; | ||
register<T extends Impl.AlpineComponent>(component: Impl.KnownClassConstructor<T>, name?: string): void; | ||
private registerConstructorAsAlpineData; | ||
private static getObjectData; | ||
private static getClassData; | ||
private logRegisterFailure; | ||
} | ||
export declare function transformToAlpineData<T extends AlpineComponent>(instance: T): object; | ||
export declare function makeAlpineConstructor<T extends AlpineComponent>(component: Impl.KnownClassConstructor<T>): Impl.AlpineComponentConstructor; |
Oops, something went wrong.