j20 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +42 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4607,17 +4607,49 @@ interface RefObject<T> {
|
|
|
4607
4607
|
declare function ref<T>(init: T): RefObject<T>;
|
|
4608
4608
|
declare function ref<T>(): RefObject<T>;
|
|
4609
4609
|
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4610
|
+
type FC<P extends Record<string, any> = {}> = {
|
|
4611
|
+
isLogic?: boolean;
|
|
4612
|
+
} & ((props: P) => JSX.Element);
|
|
4613
|
+
type AttrValueType = string | number | boolean;
|
|
4614
|
+
type CustomElement<P extends Record<string, any> = {}> = {
|
|
4615
|
+
tag: string;
|
|
4616
|
+
mode?: "open" | "closed";
|
|
4617
|
+
style?: string | CSSStyleSheet;
|
|
4618
|
+
props?: {
|
|
4619
|
+
[K in keyof P as P[K] extends AttrValueType ? K : never]?: {
|
|
4620
|
+
type: P[K] extends string ? "string" : P[K] extends number ? "number" : P[K] extends boolean ? "boolean" : never;
|
|
4621
|
+
attribute: string;
|
|
4622
|
+
};
|
|
4623
|
+
};
|
|
4615
4624
|
};
|
|
4625
|
+
type WC<P extends Record<string, string | boolean | number> = {}, E extends Record<string, any> = {}> = {
|
|
4626
|
+
customElement: CustomElement<P>;
|
|
4627
|
+
} & ((props: JSX.HTMLAttributes<HTMLElement> & {
|
|
4628
|
+
children?: JSX.Element;
|
|
4629
|
+
} & P & {
|
|
4630
|
+
[K in keyof E as `on${Capitalize<K & string>}`]: (e: E[K]) => void;
|
|
4631
|
+
}) => JSX.Element);
|
|
4632
|
+
type ExtractClasses<T extends string> = T extends `${string}.${infer Name} {${infer Body}${infer _Brace}${infer Rest}` ? Name | ExtractClasses<Body> | ExtractClasses<Rest> : T extends `${string}\n${infer Rest}` ? ExtractClasses<Rest> : never;
|
|
4616
4633
|
|
|
4617
4634
|
interface SignalLike<T = any> {
|
|
4618
4635
|
value: T;
|
|
4619
4636
|
}
|
|
4620
4637
|
|
|
4638
|
+
declare const registerWebComponent: <C extends WC<any, any>>(Comp: C) => void;
|
|
4639
|
+
declare abstract class WebComponentClass extends HTMLElement {
|
|
4640
|
+
abstract customElement: CustomElement;
|
|
4641
|
+
constructor();
|
|
4642
|
+
addStyleSheet(styleSheet: CSSStyleSheet): void;
|
|
4643
|
+
removeStyleSheet(styleSheet: CSSStyleSheet): void;
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4646
|
+
declare const wc: () => {
|
|
4647
|
+
host: WebComponentClass;
|
|
4648
|
+
emit: (name: string, detail: any) => void;
|
|
4649
|
+
onConnectedCallback: (callback: () => void) => void;
|
|
4650
|
+
onDisconnectedCallback: (callback: () => void) => void;
|
|
4651
|
+
};
|
|
4652
|
+
|
|
4621
4653
|
declare const $: <T>(val: T) => T extends SignalLike ? (typeof val)["value"] : SignalLike<T>;
|
|
4622
4654
|
|
|
4623
4655
|
declare const createContext: <T>(defaultValue: T) => {
|
|
@@ -4648,32 +4680,8 @@ declare const onMount: (callback: () => (() => void) | void) => void;
|
|
|
4648
4680
|
|
|
4649
4681
|
declare const onDestroy: (callback: () => void) => _j20org_signal.Effect;
|
|
4650
4682
|
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
} & ((props: P) => JSX.Element);
|
|
4654
|
-
type AttrValueType = string | number | boolean;
|
|
4655
|
-
type CustomElement<P extends Record<string, any> = {}> = {
|
|
4656
|
-
tag: string;
|
|
4657
|
-
mode?: "open" | "closed";
|
|
4658
|
-
style?: string | CSSStyleSheet;
|
|
4659
|
-
props?: {
|
|
4660
|
-
[K in keyof P as P[K] extends AttrValueType ? K : never]?: {
|
|
4661
|
-
type: P[K] extends string ? "string" : P[K] extends number ? "number" : P[K] extends boolean ? "boolean" : never;
|
|
4662
|
-
attribute: string;
|
|
4663
|
-
};
|
|
4664
|
-
};
|
|
4665
|
-
};
|
|
4666
|
-
type WC<P extends Record<string, string | boolean | number> = {}, E extends Record<string, any> = {}> = {
|
|
4667
|
-
customElement: CustomElement<P>;
|
|
4668
|
-
} & ((props: JSX.HTMLAttributes<HTMLElement> & {
|
|
4669
|
-
children?: JSX.Element;
|
|
4670
|
-
} & P & {
|
|
4671
|
-
[K in keyof E as `on${Capitalize<K & string>}`]: (e: E[K]) => void;
|
|
4672
|
-
}) => JSX.Element);
|
|
4673
|
-
type ExtractClasses<T extends string> = T extends `${string}.${infer Name} {${infer Body}${infer _Brace}${infer Rest}` ? Name | ExtractClasses<Body> | ExtractClasses<Rest> : T extends `${string}\n${infer Rest}` ? ExtractClasses<Rest> : never;
|
|
4674
|
-
|
|
4675
|
-
declare const sheet: (css?: string) => CSSStyleSheet;
|
|
4676
|
-
declare const css: <T extends string>(css: T) => { [K in ExtractClasses<T>]: string; };
|
|
4683
|
+
declare const createCss: <T extends string>(css: T) => () => { [K in ExtractClasses<T>]: string; };
|
|
4684
|
+
declare const styleSheet: (id: string, css?: string) => CSSStyleSheet;
|
|
4677
4685
|
|
|
4678
4686
|
interface ListProps<T> {
|
|
4679
4687
|
of: T[];
|
|
@@ -4735,7 +4743,7 @@ interface Instance {
|
|
|
4735
4743
|
id: string;
|
|
4736
4744
|
range: Text[];
|
|
4737
4745
|
root?: Element;
|
|
4738
|
-
host?:
|
|
4746
|
+
host?: WebComponentClass;
|
|
4739
4747
|
disposes?: (() => void)[];
|
|
4740
4748
|
children?: Instance[];
|
|
4741
4749
|
mounts?: (() => void)[];
|
|
@@ -4749,7 +4757,7 @@ declare const instanceCreate: (runner: () => any, parent?: Instance) => readonly
|
|
|
4749
4757
|
declare const instanceGetElements: (instance: Instance) => Node[];
|
|
4750
4758
|
declare const instanceDestroy: (parent: Instance, instance: Instance) => void;
|
|
4751
4759
|
|
|
4752
|
-
declare const createRoot: (boot: () => JSX.Element, rootElement: Element) => Instance;
|
|
4760
|
+
declare const createRoot: (boot: (...args: any[]) => JSX.Element, rootElement: Element) => Instance;
|
|
4753
4761
|
|
|
4754
4762
|
declare const h2: (tag: any, props: any, children: any) => JSX.Element;
|
|
4755
4763
|
declare const jsx: (tag: any, props: any, children: any) => JSX.Element;
|
|
@@ -4759,8 +4767,6 @@ declare const Fragment: (props: {
|
|
|
4759
4767
|
}) => any;
|
|
4760
4768
|
declare const template: (template: string) => (isSvg: boolean) => any;
|
|
4761
4769
|
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
export { $, $useContext, Case, Default, For, Fragment, If, Replace, Some, Switch, createComponent, createContext, createDom, createElement, createLogicComponent, createRoot, css, effect, getCurrentInstance, h2, id, instanceCreate, instanceCreateElement, instanceDestroy, instanceGetElements, instanceInit, jsx, jsxs, mounts, onDestroy, onMount, ref, registerWebComponent, securityGetCurrentInstance, sheet, template, wc };
|
|
4770
|
+
export { $, $useContext, Case, Default, For, Fragment, If, Replace, Some, Switch, createComponent, createContext, createCss, createDom, createElement, createLogicComponent, createRoot, effect, getCurrentInstance, h2, id, instanceCreate, instanceCreateElement, instanceDestroy, instanceGetElements, instanceInit, jsx, jsxs, mounts, onDestroy, onMount, ref, registerWebComponent, securityGetCurrentInstance, styleSheet, template, wc };
|
|
4765
4771
|
export type { AttrValueType, CaseProps, CustomElement, DOMElement, DefaultProps, ExtractClasses, FC, IfProps, Instance, ListProps, RefObject, ReplaceProps, ReplacePropsInner, SomeProps, SwitchProps, WC };
|
|
4766
4772
|
//# sourceMappingURL=index.d.ts.map
|