support 2 way data binding to components

This commit is contained in:
CoolElectronics 2024-01-01 12:43:02 -05:00
parent 0196435107
commit 01129edb48
No known key found for this signature in database
GPG key ID: F63593D168636C50
4 changed files with 75 additions and 31 deletions

9
AliceJS.d.ts vendored
View file

@ -4,20 +4,21 @@ declare namespace JSX {
declare function h(
type: string,
props: { [index: string]: any } | null,
props?: { [index: string]: any } | null,
...children: (HTMLElement | string)[]
): Node;
type AliceJSReferenceSink = { readonly __symbol: unique symbol };
type AliceJSReferenceSink<T> = { readonly __symbol: unique symbol, readonly __signature: T };
declare function use(sink: any, mapping?: (...args: any[]) => any): AliceJSReferenceSink;
declare function use<T>(sink: T | any, mapping?: (...args: any[]) => any): AliceJSReferenceSink<T>;
declare function useValue<T>(sink: AliceJSReferenceSink<T>): T;
type Stateful<T> = T & { readonly symbol: unique symbol };
declare function stateful<T>(target: T): Stateful<T>;
declare function handle(references: AliceJSReferenceSink, callback: (value: any) => void): void;
declare function handle<T>(references: AliceJSReferenceSink<T>, callback: (value: T) => void): void;
declare function css(strings: TemplateStringsArray, ...values: any): string;
declare var styled: { new: typeof css };