transone 0.1.0
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/README.md +17 -0
- package/dist/core/app.d.ts +114 -0
- package/dist/core/component/base.d.ts +79 -0
- package/dist/core/component/index.d.ts +4 -0
- package/dist/core/component.d.ts +1 -0
- package/dist/core/document.d.ts +32 -0
- package/dist/core/form.d.ts +24 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/model.d.ts +18 -0
- package/dist/core/reactive/scheduler.d.ts +32 -0
- package/dist/core/reactive/types.d.ts +24 -0
- package/dist/core/reactive.d.ts +77 -0
- package/dist/core/renderer/element-strategy.d.ts +32 -0
- package/dist/core/renderer/props.d.ts +9 -0
- package/dist/core/renderer/types.d.ts +37 -0
- package/dist/core/renderer.d.ts +43 -0
- package/dist/core/template.d.ts +50 -0
- package/dist/core/vnode.d.ts +104 -0
- package/dist/dom/index.d.ts +612 -0
- package/dist/dom/index.js +4 -0
- package/dist/dom/index.js.map +10 -0
- package/dist/index-3t506ckz.js +12 -0
- package/dist/index-3t506ckz.js.map +25 -0
- package/dist/index-mbmajrpr.js +26 -0
- package/dist/index-mbmajrpr.js.map +11 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +11 -0
- package/dist/router/history.d.ts +5 -0
- package/dist/router/index.d.ts +112 -0
- package/dist/router/index.js +4 -0
- package/dist/router/index.js.map +9 -0
- package/dist/router/instance.d.ts +26 -0
- package/dist/router/matcher.d.ts +7 -0
- package/dist/style/StyleManager.d.ts +18 -0
- package/dist/style/class-style.d.ts +0 -0
- package/dist/style/id-style.d.ts +0 -0
- package/dist/style/index.d.ts +2 -0
- package/dist/style/index.js +4 -0
- package/dist/style/index.js.map +9 -0
- package/dist/style/sheet.d.ts +13 -0
- package/dist/style/style.d.ts +0 -0
- package/package.json +59 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { AnyComponentConstructor, ComponentConstructor, ComponentEventListener, ComponentProps } from './component';
|
|
2
|
+
import type { ModelBinding } from './model';
|
|
3
|
+
export interface ComponentType {
|
|
4
|
+
mount(container: HTMLElement): void;
|
|
5
|
+
unmount(): void;
|
|
6
|
+
on(eventName: string, listener: ComponentEventListener): () => void;
|
|
7
|
+
}
|
|
8
|
+
type VNodeComponentProps = ComponentProps;
|
|
9
|
+
export type VNodeComponentConstructor<P extends VNodeComponentProps = VNodeComponentProps> = ComponentConstructor<P> | AnyComponentConstructor;
|
|
10
|
+
export type HTMLPropValue = string | number | boolean | null | undefined | Record<string, string | number> | EventListener;
|
|
11
|
+
export interface HTMLProps {
|
|
12
|
+
[key: string]: HTMLPropValue;
|
|
13
|
+
class?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: Record<string, string | number>;
|
|
16
|
+
}
|
|
17
|
+
export interface EventListeners {
|
|
18
|
+
[eventName: string]: (event: Event) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface Directions {
|
|
21
|
+
model?: ModelBinding;
|
|
22
|
+
if?: boolean;
|
|
23
|
+
show?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface VNodeBase {
|
|
26
|
+
key?: string | number;
|
|
27
|
+
slot?: string;
|
|
28
|
+
directions?: Directions;
|
|
29
|
+
}
|
|
30
|
+
export interface HTMLNode extends VNodeBase {
|
|
31
|
+
tag: string;
|
|
32
|
+
props?: HTMLProps;
|
|
33
|
+
children?: Array<VNode | string>;
|
|
34
|
+
listeners?: EventListeners;
|
|
35
|
+
}
|
|
36
|
+
export interface ComponentNode<P extends VNodeComponentProps = VNodeComponentProps> extends VNodeBase {
|
|
37
|
+
component: VNodeComponentConstructor<P>;
|
|
38
|
+
props?: P;
|
|
39
|
+
children?: Array<VNode | string>;
|
|
40
|
+
emitters?: Record<string, ComponentEventListener>;
|
|
41
|
+
}
|
|
42
|
+
export interface SlotProvider extends VNodeBase {
|
|
43
|
+
tag: 'slot';
|
|
44
|
+
props: {
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
children?: Array<VNode | string>;
|
|
48
|
+
}
|
|
49
|
+
export interface SlotInjector extends VNodeBase {
|
|
50
|
+
tag: string;
|
|
51
|
+
slot: string;
|
|
52
|
+
}
|
|
53
|
+
export type VNode = HTMLNode | ComponentNode | SlotProvider | SlotInjector;
|
|
54
|
+
export type ElementShortcutOptions = Omit<HTMLNode, 'tag'>;
|
|
55
|
+
export type ElementShortcut = (options?: ElementShortcutOptions) => HTMLNode;
|
|
56
|
+
export declare function isComponentNode(vnode: VNode): vnode is ComponentNode;
|
|
57
|
+
export declare function isHTMLNode(vnode: VNode): vnode is HTMLNode;
|
|
58
|
+
export declare function isSlotProvider(vnode: VNode): vnode is SlotProvider;
|
|
59
|
+
export declare function h(tag: string, props?: HTMLProps, children?: Array<VNode | string>, listeners?: EventListeners, key?: string | number, directions?: Directions): HTMLNode;
|
|
60
|
+
export declare function Tag(tag: string, options?: ElementShortcutOptions): HTMLNode;
|
|
61
|
+
export declare const Div: ElementShortcut;
|
|
62
|
+
export declare const Span: ElementShortcut;
|
|
63
|
+
export declare const P: ElementShortcut;
|
|
64
|
+
export declare const Button: ElementShortcut;
|
|
65
|
+
export declare const Input: ElementShortcut;
|
|
66
|
+
export declare const Section: ElementShortcut;
|
|
67
|
+
export declare const Main: ElementShortcut;
|
|
68
|
+
export declare const Header: ElementShortcut;
|
|
69
|
+
export declare const Footer: ElementShortcut;
|
|
70
|
+
export declare const Nav: ElementShortcut;
|
|
71
|
+
export declare const Article: ElementShortcut;
|
|
72
|
+
export declare const Aside: ElementShortcut;
|
|
73
|
+
export declare const H1: ElementShortcut;
|
|
74
|
+
export declare const H2: ElementShortcut;
|
|
75
|
+
export declare const H3: ElementShortcut;
|
|
76
|
+
export declare const H4: ElementShortcut;
|
|
77
|
+
export declare const H5: ElementShortcut;
|
|
78
|
+
export declare const H6: ElementShortcut;
|
|
79
|
+
export declare const Strong: ElementShortcut;
|
|
80
|
+
export declare const Em: ElementShortcut;
|
|
81
|
+
export declare const Small: ElementShortcut;
|
|
82
|
+
export declare const Pre: ElementShortcut;
|
|
83
|
+
export declare const Code: ElementShortcut;
|
|
84
|
+
export declare const Blockquote: ElementShortcut;
|
|
85
|
+
export declare const Ul: ElementShortcut;
|
|
86
|
+
export declare const Ol: ElementShortcut;
|
|
87
|
+
export declare const Li: ElementShortcut;
|
|
88
|
+
export declare const A: ElementShortcut;
|
|
89
|
+
export declare const Img: ElementShortcut;
|
|
90
|
+
export declare const Form: ElementShortcut;
|
|
91
|
+
export declare const Label: ElementShortcut;
|
|
92
|
+
export declare const Textarea: ElementShortcut;
|
|
93
|
+
export declare const Select: ElementShortcut;
|
|
94
|
+
export declare const Option: ElementShortcut;
|
|
95
|
+
export declare const Table: ElementShortcut;
|
|
96
|
+
export declare const Thead: ElementShortcut;
|
|
97
|
+
export declare const Tbody: ElementShortcut;
|
|
98
|
+
export declare const Tr: ElementShortcut;
|
|
99
|
+
export declare const Th: ElementShortcut;
|
|
100
|
+
export declare const Td: ElementShortcut;
|
|
101
|
+
export declare function createComponent<P extends VNodeComponentProps>(componentClass: ComponentConstructor<P>, props?: P, children?: Array<VNode | string>, key?: string | number, directions?: Directions): ComponentNode<P>;
|
|
102
|
+
export declare function slot(name: string, key?: string | number, directions?: Directions): SlotProvider;
|
|
103
|
+
export declare function each<T>(items: readonly T[], render: (item: T, index: number) => VNode | string, key: (item: T, index: number) => string | number): VNode[];
|
|
104
|
+
export {};
|