fix css and types

This commit is contained in:
CoolElectronics 2024-02-16 18:59:55 -05:00
parent 2d577a6a99
commit f286085c3a
No known key found for this signature in database
GPG key ID: F63593D168636C50
2 changed files with 11 additions and 5 deletions

14
AliceJS.d.ts vendored
View file

@ -8,17 +8,17 @@ declare function h(
...children: (HTMLElement | string)[]
): Node;
type AliceJSReferenceSink<T> = { readonly __symbol: unique symbol, readonly __signature: T };
type DLPointer<T> = { readonly __symbol: unique symbol, readonly __signature: T };
declare function use<T>(sink: T | any, mapping?: (...args: any[]) => any): AliceJSReferenceSink<T>;
declare function useValue<T>(sink: AliceJSReferenceSink<T>): T;
declare function use<T>(sink: T, mapping?: (arg: T) => any): DLPointer<T>;
declare function useValue<T>(trap: DLPointer<T>): T;
type Stateful<T> = T & { readonly symbol: unique symbol };
declare function stateful<T>(target: T): Stateful<T>;
declare function handle<T>(references: AliceJSReferenceSink<T>, callback: (value: T) => void): void;
declare function handle<T>(references: DLPointer<T>, callback: (value: T) => void): void;
declare function css(strings: TemplateStringsArray, ...values: any): string;
declare function rule(strings: TemplateStringsArray, ...values: any): string;
@ -30,6 +30,12 @@ interface Element {
$: DLComponent<any>
}
interface DLElement<T> extends Element {
$: T
}
declare var $el: HTMLElement;
type DLComponent<T> = {
css: DLCSS,
root: Element,