@motifx/core 1.0.1
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/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/chunks/core-BDvHkZLQ.esm.js +1601 -0
- package/dist/chunks/core-BDvHkZLQ.esm.js.map +1 -0
- package/dist/chunks/core-DXGu4dNE.cjs +1642 -0
- package/dist/chunks/core-DXGu4dNE.cjs.map +1 -0
- package/dist/chunks/core-DfzGo_Ti.cjs +10213 -0
- package/dist/chunks/core-DfzGo_Ti.cjs.map +1 -0
- package/dist/chunks/core-DxINgP83.esm.js +10179 -0
- package/dist/chunks/core-DxINgP83.esm.js.map +1 -0
- package/dist/devtools.cjs +9 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.cts +16 -0
- package/dist/devtools.d.ts +16 -0
- package/dist/devtools.esm.js +2 -0
- package/dist/devtools.esm.js.map +1 -0
- package/dist/index.cjs +1517 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1470 -0
- package/dist/index.d.ts +1470 -0
- package/dist/index.esm.js +1449 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.esm.min.js +2 -0
- package/dist/index.esm.min.js.map +1 -0
- package/dist/index.umd.js +13283 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/index.umd.min.js +2 -0
- package/dist/index.umd.min.js.map +1 -0
- package/dist/jsx-runtime.cjs +6 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.cts +136 -0
- package/dist/jsx-runtime.d.ts +136 -0
- package/dist/jsx-runtime.esm.js +6 -0
- package/dist/jsx-runtime.esm.js.map +1 -0
- package/package.json +124 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1470 @@
|
|
|
1
|
+
export { AnyFunctionalComponent, JSX, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr } from './jsx-runtime.js';
|
|
2
|
+
|
|
3
|
+
interface IDisposable {
|
|
4
|
+
dispose(): void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare class DisposableStore implements IDisposable {
|
|
8
|
+
private readonly _items;
|
|
9
|
+
private _closed;
|
|
10
|
+
constructor();
|
|
11
|
+
get isDisposed(): boolean;
|
|
12
|
+
add<T extends IDisposable>(item: T): T;
|
|
13
|
+
delete<T extends IDisposable>(item: T): void;
|
|
14
|
+
detach<T extends IDisposable>(item: T): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare abstract class Disposable implements IDisposable {
|
|
20
|
+
constructor();
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface IDisposableTracker {
|
|
25
|
+
trackDisposable(disposable: IDisposable): void;
|
|
26
|
+
setParent(child: IDisposable, parent: IDisposable | null): void;
|
|
27
|
+
markAsDisposed(disposable: IDisposable): void;
|
|
28
|
+
markAsSingleton(disposable: IDisposable): void;
|
|
29
|
+
}
|
|
30
|
+
declare class DisposableCore {
|
|
31
|
+
disposableTracker: IDisposableTracker | null;
|
|
32
|
+
notifyCreated<T extends IDisposable>(target: T): T;
|
|
33
|
+
notifyDisposed(target: IDisposable): void;
|
|
34
|
+
notifyOwner(target: IDisposable, owner: IDisposable | null): void;
|
|
35
|
+
toDisposable(fn: () => void): IDisposable;
|
|
36
|
+
}
|
|
37
|
+
declare const disposableCore: DisposableCore;
|
|
38
|
+
|
|
39
|
+
interface BindingFormatInfo {
|
|
40
|
+
locale?: string | string[];
|
|
41
|
+
currency?: string;
|
|
42
|
+
}
|
|
43
|
+
interface IBaseBinding {
|
|
44
|
+
propertyName: string;
|
|
45
|
+
dataSource: any;
|
|
46
|
+
dataMember?: string;
|
|
47
|
+
formatString?: string;
|
|
48
|
+
converter?: (value: any) => any;
|
|
49
|
+
converterBack?: (value: any) => any;
|
|
50
|
+
setter?: (value: any) => void;
|
|
51
|
+
formatInfo?: BindingFormatInfo;
|
|
52
|
+
updateMode?: 'onPropertyChanged' | 'onValidation' | 'never';
|
|
53
|
+
activate(): void;
|
|
54
|
+
deactivate(): void;
|
|
55
|
+
reActivate(): void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface IBindingCollection {
|
|
59
|
+
add(propertyName: string, dataSource: any): IBaseBinding;
|
|
60
|
+
add(propertyName: string, dataSource: any, dataMember: string): IBaseBinding;
|
|
61
|
+
add(propertyName: string, dataSource: any, dataMember: string, formatString: string): IBaseBinding;
|
|
62
|
+
add(propertyName: string, dataSource: any, dataMember: string, formatString: string, formatInfo: BindingFormatInfo): IBaseBinding;
|
|
63
|
+
add(binding: IBaseBinding): IBaseBinding;
|
|
64
|
+
wait(predicate: () => any): IBaseBinding;
|
|
65
|
+
when(conditionFn: () => any, effectFn: (isTrue: boolean) => any): IBaseBinding;
|
|
66
|
+
ternary(conditionFn: () => any, trueFn: (frame: any) => any, falseFn: (frame: any) => any): IBaseBinding;
|
|
67
|
+
list(itemsFn: () => any[] | Iterable<any>, renderFn: (item: any, index: number) => ComponentBase): IBaseBinding;
|
|
68
|
+
list(itemsFn: () => any[] | Iterable<any>, renderFn: (item: any, index: number) => ComponentBase, options: ListBindingOptions): IBaseBinding;
|
|
69
|
+
remove(binding: IBaseBinding): void;
|
|
70
|
+
clear(): void;
|
|
71
|
+
items: IBaseBinding[];
|
|
72
|
+
switchCase(discriminatorFn: () => any, cases: Record<string | number, (frame: any) => any>, defaultFn?: (frame: any) => any): any;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface ListBindingOptions {
|
|
76
|
+
reuse?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare class BindingCollection implements IBindingCollection {
|
|
80
|
+
private _items;
|
|
81
|
+
private _component;
|
|
82
|
+
private _branchScope;
|
|
83
|
+
constructor(component: ComponentBase);
|
|
84
|
+
private _own;
|
|
85
|
+
when(computeFn: () => any, renderFn: (isTrue: boolean) => any): any;
|
|
86
|
+
get items(): IBaseBinding[];
|
|
87
|
+
text(cb: any): void;
|
|
88
|
+
value(fn: () => any): void;
|
|
89
|
+
add(propertyName: string, dataSource: any): IBaseBinding;
|
|
90
|
+
add(propertyName: string, dataSource: any, dataMember: string): IBaseBinding;
|
|
91
|
+
add(propertyName: string, dataSource: any, dataMember: string, formatString: string): IBaseBinding;
|
|
92
|
+
add(propertyName: string, dataSource: any, dataMember: string, formatString: string, formatInfo: BindingFormatInfo): IBaseBinding;
|
|
93
|
+
add(binding: IBaseBinding): IBaseBinding;
|
|
94
|
+
wait(predicate: () => any): IBaseBinding;
|
|
95
|
+
display(predicate: () => any): IBaseBinding;
|
|
96
|
+
html(predicate: () => any): IBaseBinding;
|
|
97
|
+
list(itemsFn: () => any[] | Iterable<any>, renderFn: (item: any, index: number) => ComponentBase): IBaseBinding;
|
|
98
|
+
list(itemsFn: () => any[] | Iterable<any>, renderFn: (item: any, index: number) => ComponentBase, options: ListBindingOptions): IBaseBinding;
|
|
99
|
+
loop(itemsFn: () => any[] | Iterable<any>, renderFn: (item: any, index: number) => ComponentBase): IBaseBinding;
|
|
100
|
+
loop(itemsFn: () => any[] | Iterable<any>, renderFn: (item: any, index: number) => ComponentBase, options: ListBindingOptions): IBaseBinding;
|
|
101
|
+
method(cb: () => any): void;
|
|
102
|
+
ternary(conditionFn: () => any, trueFn: (frame: Frame) => any, falseFn: (frame: Frame) => any): any;
|
|
103
|
+
private _ternarySchedule;
|
|
104
|
+
private ternaryCall;
|
|
105
|
+
private _ternaryCallTop;
|
|
106
|
+
watch(cb: () => any): void;
|
|
107
|
+
remove(binding: IBaseBinding): void;
|
|
108
|
+
clear(): void;
|
|
109
|
+
activateAll(): void;
|
|
110
|
+
model(dataSource: any): IBaseBinding;
|
|
111
|
+
model(dataSource: any, dataMember: string): IBaseBinding;
|
|
112
|
+
model(dataSource: any, dataMember: string, formatString: string): IBaseBinding;
|
|
113
|
+
model(dataSource: any, dataMember: string, formatString: string, formatInfo: BindingFormatInfo): IBaseBinding;
|
|
114
|
+
model(getter: () => any, setter: (value: any) => void): IBaseBinding;
|
|
115
|
+
model(binding: IBaseBinding): IBaseBinding;
|
|
116
|
+
deactivateAll(): void;
|
|
117
|
+
reActivateAll(): void;
|
|
118
|
+
switchCase(discriminatorFn: () => any, cases: Record<string | number, (frame: Frame) => any>, defaultFn?: (frame: Frame) => any): any;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
type Event$1<T> = (listener: (value: T) => unknown, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => IDisposable;
|
|
122
|
+
|
|
123
|
+
declare class Emitter<T> {
|
|
124
|
+
private _subscriptions;
|
|
125
|
+
private _delivery;
|
|
126
|
+
private _subscribe;
|
|
127
|
+
private _disposed;
|
|
128
|
+
get event(): Event$1<T>;
|
|
129
|
+
fire(value: T): void;
|
|
130
|
+
dispose(): void;
|
|
131
|
+
private _writable;
|
|
132
|
+
private _unsubscribe;
|
|
133
|
+
private _resume;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
type TransitionKind = 'transition' | 'animation';
|
|
137
|
+
interface CSSTransitionInfo {
|
|
138
|
+
type: TransitionKind | null;
|
|
139
|
+
timeout: number;
|
|
140
|
+
propCount: number;
|
|
141
|
+
hasTransform: boolean;
|
|
142
|
+
}
|
|
143
|
+
interface TransitionProps {
|
|
144
|
+
name?: string;
|
|
145
|
+
type?: TransitionKind;
|
|
146
|
+
css?: boolean;
|
|
147
|
+
duration?: number | {
|
|
148
|
+
enter: number;
|
|
149
|
+
leave: number;
|
|
150
|
+
};
|
|
151
|
+
enterFromClass?: string;
|
|
152
|
+
enterActiveClass?: string;
|
|
153
|
+
enterToClass?: string;
|
|
154
|
+
appearFromClass?: string;
|
|
155
|
+
appearActiveClass?: string;
|
|
156
|
+
appearToClass?: string;
|
|
157
|
+
leaveFromClass?: string;
|
|
158
|
+
leaveActiveClass?: string;
|
|
159
|
+
leaveToClass?: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface IHtmlElement extends HTMLElement {
|
|
163
|
+
}
|
|
164
|
+
interface IElement extends Node {
|
|
165
|
+
}
|
|
166
|
+
type ElementType = IElement | IHtmlElement | DocumentFragment | Comment | Text;
|
|
167
|
+
type CustomParameters<T extends any> = T extends (...args: infer P) => any ? P[0] : never;
|
|
168
|
+
type IsOptional<T> = T extends {} ? {
|
|
169
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? true : false;
|
|
170
|
+
}[keyof T] : false;
|
|
171
|
+
type OptionalParams<T> = T extends null ? {
|
|
172
|
+
params?: undefined;
|
|
173
|
+
} : T extends undefined ? {
|
|
174
|
+
params?: undefined;
|
|
175
|
+
} : IsOptional<T> extends true ? T : T;
|
|
176
|
+
interface EventArgs {
|
|
177
|
+
cancel: boolean;
|
|
178
|
+
}
|
|
179
|
+
type RouterClassingSettings = {
|
|
180
|
+
to: 'all' | 'active' | 'exact' | 'none';
|
|
181
|
+
path: string;
|
|
182
|
+
activeClass?: string;
|
|
183
|
+
exactClass?: string;
|
|
184
|
+
onActive?: () => void;
|
|
185
|
+
offActive?: () => void;
|
|
186
|
+
onExact?: () => void;
|
|
187
|
+
offExact?: () => void;
|
|
188
|
+
};
|
|
189
|
+
interface ComponentBaseOptions<TProps> {
|
|
190
|
+
props?: TProps;
|
|
191
|
+
[key: string]: any;
|
|
192
|
+
cache?: DocumentFragment;
|
|
193
|
+
closeFragment?: Comment;
|
|
194
|
+
transition: {
|
|
195
|
+
transitionInfo: () => {
|
|
196
|
+
in: CSSTransitionInfo;
|
|
197
|
+
out: CSSTransitionInfo;
|
|
198
|
+
};
|
|
199
|
+
name: string;
|
|
200
|
+
classes?: TransitionProps;
|
|
201
|
+
activeCssCancel: (() => void) | null;
|
|
202
|
+
activeCssPhase: 'enter' | 'leave' | null;
|
|
203
|
+
cssProps: () => TransitionProps | null;
|
|
204
|
+
skipNextLeave: boolean;
|
|
205
|
+
in: (op: {
|
|
206
|
+
keyframes: Keyframe[] | PropertyIndexedKeyframes | null;
|
|
207
|
+
options?: number | KeyframeAnimationOptions;
|
|
208
|
+
}) => void;
|
|
209
|
+
out: (op: {
|
|
210
|
+
keyframes: Keyframe[] | PropertyIndexedKeyframes | null;
|
|
211
|
+
options?: number | KeyframeAnimationOptions;
|
|
212
|
+
}) => void;
|
|
213
|
+
enterTransition: (resolve: () => void) => Animation;
|
|
214
|
+
leaveTransition: (resolve: () => void) => Animation;
|
|
215
|
+
activeAnimations: Animation[];
|
|
216
|
+
run: (keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions, resolve?: () => void) => Animation;
|
|
217
|
+
};
|
|
218
|
+
set enableRouterClassing(value: RouterClassingSettings);
|
|
219
|
+
getInstance(): any;
|
|
220
|
+
hasEvent: (name: string) => boolean;
|
|
221
|
+
}
|
|
222
|
+
type AnyEvents = {
|
|
223
|
+
[key: string]: any;
|
|
224
|
+
};
|
|
225
|
+
type HtmlElementEvents = {
|
|
226
|
+
[K in keyof IHtmlElement as K extends `on${string}` ? Uncapitalize<K extends `on${infer EventName}` ? EventName : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:passive` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:passive:prevent` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:passive:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:passive:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:passive:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:passive:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:prevent` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:prevent:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:prevent:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:prevent:trusted:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:prevent:trusted:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:stop:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:stop:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:stop:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:trusted:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:once:trusted:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:prevent` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:prevent:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:prevent:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:prevent:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:prevent:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:stop:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:stop:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:stop:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:trusted:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:trusted:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:capture:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:passive:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:prevent` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:prevent:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:prevent:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:prevent:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:prevent:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:stop` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:stop:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:stop:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:stop:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:trusted` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:trusted:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:trusted:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:capture` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:capture:self` : never> | Uncapitalize<K extends `on${infer EventName}` ? `${EventName}:self` : never> : 'x:building' | 'x:built' | 'x:initializing' | 'x:initialized' | 'x:disposing' | 'x:disposed' | 'x:config' | 'x:configured' | 'x:visibilityChanged' | 'x:mounted']: CustomParameters<IHtmlElement[K]> extends Event ? CustomParameters<IHtmlElement[K]> : EventArgs;
|
|
227
|
+
} & AnyEvents;
|
|
228
|
+
|
|
229
|
+
type ElementTypes = Node | Element | HTMLElement | Text | DocumentFragment | Comment | HTMLDivElement;
|
|
230
|
+
declare class controlAttribute<ElementType extends ElementTypes> implements IAttribute<ComponentBase<ElementType, any>> {
|
|
231
|
+
private _parent;
|
|
232
|
+
private _attrMap;
|
|
233
|
+
private _watchers;
|
|
234
|
+
constructor(parent: ComponentBase<ElementType, any>);
|
|
235
|
+
/** @deprecated Tek kaynak `_attrMap`; geriye dönük okuma için türetilmiş görünüm. */
|
|
236
|
+
get attributes(): {
|
|
237
|
+
name: string;
|
|
238
|
+
value: any;
|
|
239
|
+
}[];
|
|
240
|
+
add(attribute: object | string): ComponentBase<ElementType, any>;
|
|
241
|
+
remove(key: string): ComponentBase<ElementType, any>;
|
|
242
|
+
has(key: string): boolean;
|
|
243
|
+
get(key: string): string | null;
|
|
244
|
+
parse(values: any, key: any): void;
|
|
245
|
+
private _applyValue;
|
|
246
|
+
private _getElement;
|
|
247
|
+
hasMethodState(key: string): boolean;
|
|
248
|
+
getMethodState(key: string): any;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare const opaqueBrand: unique symbol;
|
|
252
|
+
declare const shallowBrand: unique symbol;
|
|
253
|
+
type OpaqueState = Function | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | string | number | boolean | {
|
|
254
|
+
[opaqueBrand]?: true;
|
|
255
|
+
};
|
|
256
|
+
type DeepState<T> = T extends OpaqueState ? T : T extends Array<any> ? {
|
|
257
|
+
[Index in keyof T]: DeepState<T[Index]>;
|
|
258
|
+
} : T extends object & {
|
|
259
|
+
[shallowBrand]?: never;
|
|
260
|
+
} ? {
|
|
261
|
+
[Key in keyof T]: Key extends symbol ? T[Key] : DeepState<T[Key]>;
|
|
262
|
+
} : T;
|
|
263
|
+
interface BoxedPrimitive<T> {
|
|
264
|
+
value: T;
|
|
265
|
+
}
|
|
266
|
+
type UnwrapValueRefs<T> = T extends number | string | boolean ? BoxedPrimitive<T> : DeepState<T>;
|
|
267
|
+
|
|
268
|
+
declare class ComponentMotif<TSelf extends ComponentBase = ComponentBase, TProps extends object = any> {
|
|
269
|
+
private readonly _component;
|
|
270
|
+
options: ComponentBaseOptions<TProps> & {
|
|
271
|
+
hideStrategy?: 'placeholder' | 'detach' | 'auto';
|
|
272
|
+
placeholder?: Comment;
|
|
273
|
+
};
|
|
274
|
+
constructor(component: TSelf, options: ComponentMotif<TSelf, TProps>['options']);
|
|
275
|
+
show(): Promise<any>;
|
|
276
|
+
hide(): Promise<any>;
|
|
277
|
+
toggle(): void;
|
|
278
|
+
on<K extends keyof HtmlElementEvents>(event: K, cb: (sender: TSelf, ev: HtmlElementEvents[K]) => any, domEvent?: boolean): Promise<TSelf>;
|
|
279
|
+
off<K extends keyof HtmlElementEvents>(event: K, cb: (sender: TSelf, ev: HtmlElementEvents[K]) => any): Promise<TSelf>;
|
|
280
|
+
trigger(event: any, ev: any): Promise<TSelf>;
|
|
281
|
+
addHandler(event: any, handler: (sender: ComponentBase, e: EventArgs) => void): void;
|
|
282
|
+
clear(): Promise<any>;
|
|
283
|
+
register(c: IDisposable): void;
|
|
284
|
+
setDisposable(c: () => void): void;
|
|
285
|
+
stopAnimations(): Promise<void>;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
type IBaseProp<T extends any> = OptionalParams<T> & {
|
|
289
|
+
childs?: any[];
|
|
290
|
+
options?: any;
|
|
291
|
+
onElementCreating?(): any;
|
|
292
|
+
initializeComponent?(sender: ComponentBase): void;
|
|
293
|
+
onBuilding?(sender: ComponentBase, e: EventArgs): void;
|
|
294
|
+
onBuilt?(sender: ComponentBase, e: EventArgs): void;
|
|
295
|
+
onMounted?(sender: ComponentBase, e: EventArgs): void;
|
|
296
|
+
onInitializing?(sender: ComponentBase, e: EventArgs): void;
|
|
297
|
+
onInitialized?(sender: ComponentBase, e: EventArgs): void;
|
|
298
|
+
onDisposing?(sender: ComponentBase, e: EventArgs): void;
|
|
299
|
+
onDisposed?(sender: ComponentBase, e: EventArgs): void;
|
|
300
|
+
onConfig?(sender: ComponentBase, e: EventArgs): void;
|
|
301
|
+
onConfigured?(sender: ComponentBase, e: EventArgs): void;
|
|
302
|
+
onVisibilityChanged?(sender: ComponentBase, e: EventArgs): void;
|
|
303
|
+
onActivated?(sender: ComponentBase, e: EventArgs): void;
|
|
304
|
+
onDeactivated?(sender: ComponentBase, e: EventArgs): void;
|
|
305
|
+
runover?: {
|
|
306
|
+
initializeComponent?: (sender: ComponentBase) => void;
|
|
307
|
+
};
|
|
308
|
+
[key: string]: any;
|
|
309
|
+
};
|
|
310
|
+
interface IDisposeOptions {
|
|
311
|
+
deep?: boolean;
|
|
312
|
+
skipLeaveTransition?: boolean;
|
|
313
|
+
}
|
|
314
|
+
declare abstract class ComponentBase<TElement extends ElementType = any, TProps extends object = any> extends Disposable {
|
|
315
|
+
readonly motif: ComponentMotif<this, TProps>;
|
|
316
|
+
element: TElement;
|
|
317
|
+
props: TProps;
|
|
318
|
+
isBuilt: boolean;
|
|
319
|
+
isInitialized: boolean;
|
|
320
|
+
isDisposed: boolean;
|
|
321
|
+
isConfigured: boolean;
|
|
322
|
+
isPainting: boolean;
|
|
323
|
+
isPainted: boolean;
|
|
324
|
+
isVisible: boolean;
|
|
325
|
+
controls: ControlCollection;
|
|
326
|
+
private _eventHandlers?;
|
|
327
|
+
private _isWait;
|
|
328
|
+
class: IClass<TElement>;
|
|
329
|
+
attr: controlAttribute<TElement>;
|
|
330
|
+
bindings: BindingCollection;
|
|
331
|
+
/** style(fn) izleyicisi: tek tek tutulur, yeniden çağrıda önceki durdurulur. */
|
|
332
|
+
private _styleFx?;
|
|
333
|
+
useModel<TModel>(modelCtor: TModel): UnwrapValueRefs<TModel>;
|
|
334
|
+
private _computeHideStrategy;
|
|
335
|
+
private _isInDom;
|
|
336
|
+
set isWait(value: boolean);
|
|
337
|
+
get isWait(): boolean;
|
|
338
|
+
constructor(element: TElement, props?: TProps);
|
|
339
|
+
childs?: any[];
|
|
340
|
+
parent: ComponentBase | null;
|
|
341
|
+
onElementCreating?(): TElement;
|
|
342
|
+
initializeComponent?(sender: ComponentBase): void;
|
|
343
|
+
onBuilding?(sender: ComponentBase, e: EventArgs): void;
|
|
344
|
+
onBuilt?(sender: ComponentBase, e: EventArgs): void;
|
|
345
|
+
onMounted?(sender: ComponentBase, e: EventArgs): void;
|
|
346
|
+
onInitializing?(sender: ComponentBase, e: EventArgs): void;
|
|
347
|
+
onInitialized?(sender: ComponentBase, e: EventArgs): void;
|
|
348
|
+
onDisposing?(sender: ComponentBase, e: EventArgs): void;
|
|
349
|
+
onDisposed?(sender: ComponentBase, e: EventArgs): void;
|
|
350
|
+
onConfig?(sender: ComponentBase, e: EventArgs): void;
|
|
351
|
+
onConfigured?(sender: ComponentBase, e: EventArgs): void;
|
|
352
|
+
onVisibilityChanged?(sender: ComponentBase, e: EventArgs): void;
|
|
353
|
+
/** keepAlive rota bileşeni outlet'ten ayrılıp önbelleğe alındığında (RoutingEngine) tetiklenir. */
|
|
354
|
+
onDeactivated?(sender: ComponentBase, e: EventArgs): void;
|
|
355
|
+
/** keepAlive rota bileşeni önbellekten outlet'e yeniden bağlandığında (RoutingEngine) tetiklenir. */
|
|
356
|
+
onActivated?(sender: ComponentBase, e: EventArgs): void;
|
|
357
|
+
view?(): ComponentBase;
|
|
358
|
+
private _scopedContext?;
|
|
359
|
+
get context(): Application;
|
|
360
|
+
build(building?: boolean): void;
|
|
361
|
+
setState(): void;
|
|
362
|
+
reState(): void;
|
|
363
|
+
setText(value: string): void;
|
|
364
|
+
style(content: CSSStyleDeclaration | string | Array<any> | Object | (() => any)): any;
|
|
365
|
+
private _stopStyleEffect;
|
|
366
|
+
private _addHandler;
|
|
367
|
+
private _show;
|
|
368
|
+
private _hide;
|
|
369
|
+
private _toggle;
|
|
370
|
+
private _on;
|
|
371
|
+
private _trigger;
|
|
372
|
+
private _off;
|
|
373
|
+
/** Süren bertaraf: ikinci bir dispose/disposeAsync çağrısı yenisini başlatmaz, bunu bekler. */
|
|
374
|
+
private _disposing?;
|
|
375
|
+
dispose(options?: IDisposeOptions): Promise<void>;
|
|
376
|
+
private _disposeCore;
|
|
377
|
+
disposeAsync(options?: IDisposeOptions): Promise<void>;
|
|
378
|
+
private _disposeAsyncCore;
|
|
379
|
+
using<T>(waitable: Promise<any>, onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected?: ((reason: any) => never | PromiseLike<never>) | undefined | null): void;
|
|
380
|
+
doWork<T>(waitable: Promise<T> | PromiseLike<T>): Promise<T>;
|
|
381
|
+
siblings: {
|
|
382
|
+
all: () => ComponentBase<any, any>[] | undefined;
|
|
383
|
+
next: () => ComponentBase<any, any> | undefined;
|
|
384
|
+
prev: () => ComponentBase<any, any> | undefined;
|
|
385
|
+
nextAll: () => any;
|
|
386
|
+
prevAll: () => any;
|
|
387
|
+
};
|
|
388
|
+
get serviceProvider(): ServiceProvider | null;
|
|
389
|
+
getService<T = any>(token: any): T | null;
|
|
390
|
+
$(selector: string): {
|
|
391
|
+
fromDom: () => any;
|
|
392
|
+
fromComponent: () => ComponentBase<any, any>[];
|
|
393
|
+
};
|
|
394
|
+
private _stopAnimations;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
declare class Component<TElement extends ElementType = any, TProps extends object = any> extends ComponentBase<TElement, TProps> {
|
|
398
|
+
static elementTag?: string;
|
|
399
|
+
static elementNamespace?: string;
|
|
400
|
+
constructor(elementOrParams: TElement | string | IBaseProp<TProps>);
|
|
401
|
+
constructor(element: TElement | string, options: IBaseProp<TProps>);
|
|
402
|
+
constructor(elementOrParams: TElement | string | IBaseProp<TProps>, options?: IBaseProp<TProps>);
|
|
403
|
+
constructor(elementOrParams?: TElement | string | IBaseProp<TProps>, options?: IBaseProp<TProps>);
|
|
404
|
+
}
|
|
405
|
+
type viewFn<P extends object> = (props: P) => any;
|
|
406
|
+
declare function FNComponent<P extends object>(view: viewFn<P>): (props: P) => FragmentNode<any>;
|
|
407
|
+
declare function motifComponent(element: unknown, props?: any): any;
|
|
408
|
+
declare function motifFragment(props?: any): FragmentNode<any>;
|
|
409
|
+
declare class FragmentNode<TProps extends object = any> extends Component<Comment, TProps> {
|
|
410
|
+
constructor(options?: IBaseProp<TProps>);
|
|
411
|
+
constructor(element: any, props: any);
|
|
412
|
+
initializeComponent(sender: ComponentBase): void;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
interface LazyOptions<T = any> {
|
|
416
|
+
Loaderview?: ComponentBase;
|
|
417
|
+
Placeholderview?: ComponentBase;
|
|
418
|
+
Fallbackview?: ComponentBase;
|
|
419
|
+
minDelayMs?: number;
|
|
420
|
+
onError?: (error: unknown) => void;
|
|
421
|
+
mapResult?: (result: T) => any;
|
|
422
|
+
timeoutMs?: number;
|
|
423
|
+
signal?: AbortSignal;
|
|
424
|
+
retry?: number | LazyRetryOptions;
|
|
425
|
+
onRetry?: (attempt: number, error: unknown) => void;
|
|
426
|
+
}
|
|
427
|
+
interface LazyRetryOptions {
|
|
428
|
+
count: number;
|
|
429
|
+
delayMs?: number;
|
|
430
|
+
whenOnline?: boolean;
|
|
431
|
+
}
|
|
432
|
+
declare function Lazy<T>(props: {
|
|
433
|
+
caller: () => Promise<T>;
|
|
434
|
+
options?: LazyOptions<T>;
|
|
435
|
+
}): Component;
|
|
436
|
+
declare function Lazy(props: any): Component;
|
|
437
|
+
|
|
438
|
+
declare class Frame extends Component {
|
|
439
|
+
current: ComponentBase | ComponentBase[] | null;
|
|
440
|
+
isBusy: boolean;
|
|
441
|
+
constructor(props?: any);
|
|
442
|
+
dispose(): Promise<void>;
|
|
443
|
+
flush(): Promise<void>;
|
|
444
|
+
previouspage: any;
|
|
445
|
+
navigate(page: ComponentBase | ComponentBase[], keepOldControl?: boolean): Promise<void>;
|
|
446
|
+
navigateLazy<T>(caller: () => Promise<T>, options?: LazyOptions<T>, keepOldControl?: boolean): Promise<void>;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
declare function preProcessing(callback: () => any): void;
|
|
450
|
+
|
|
451
|
+
interface ContentBlockProps {
|
|
452
|
+
target: string;
|
|
453
|
+
}
|
|
454
|
+
declare class ContentBlock extends Component<any, ContentBlockProps> {
|
|
455
|
+
constructor(props: ContentBlockProps);
|
|
456
|
+
onConfigured(sender: ComponentBase, e: EventArgs): void;
|
|
457
|
+
onDisposing(sender: ComponentBase, e: EventArgs): void;
|
|
458
|
+
ondisposing(sender: Component<any, ContentBlockProps>): void;
|
|
459
|
+
}
|
|
460
|
+
interface ContentBodyProps {
|
|
461
|
+
name: string;
|
|
462
|
+
onconfig?: any;
|
|
463
|
+
}
|
|
464
|
+
declare class ContentBody extends Component<any, ContentBodyProps> {
|
|
465
|
+
constructor(props: ContentBodyProps);
|
|
466
|
+
ondisposing(sender: Component<any, ContentBodyProps>): void;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
declare class Transport extends Component<any, {
|
|
470
|
+
name: string;
|
|
471
|
+
mode?: 'replace' | 'merge';
|
|
472
|
+
}> {
|
|
473
|
+
mode: 'replace' | 'merge';
|
|
474
|
+
constructor(props: {
|
|
475
|
+
name: string;
|
|
476
|
+
mode?: 'replace' | 'merge';
|
|
477
|
+
});
|
|
478
|
+
initializeComponent(sender: ComponentBase): void;
|
|
479
|
+
clearSlot(): void;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
declare class TransportTo extends Component<any, {
|
|
483
|
+
name: string;
|
|
484
|
+
}> {
|
|
485
|
+
private _onAddRef?;
|
|
486
|
+
private _onRemoveRef?;
|
|
487
|
+
private _slotRegisteredListener?;
|
|
488
|
+
private _slotUnregisteredListener?;
|
|
489
|
+
private _transported;
|
|
490
|
+
constructor(props: {
|
|
491
|
+
name: string;
|
|
492
|
+
});
|
|
493
|
+
private _handleSlotChange;
|
|
494
|
+
private _clearChildrenFromSlot;
|
|
495
|
+
initializeComponent(sender: ComponentBase): void;
|
|
496
|
+
onDisposing(sender: ComponentBase, e: EventArgs): void;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
interface TransportOptions {
|
|
500
|
+
index?: number;
|
|
501
|
+
keepState?: boolean;
|
|
502
|
+
owner?: any;
|
|
503
|
+
}
|
|
504
|
+
declare class Transporter {
|
|
505
|
+
static transport(child: ComponentBase, newParent: ComponentBase, options?: TransportOptions): void;
|
|
506
|
+
static transportMany(children: ComponentBase[], newParent: ComponentBase, options?: TransportOptions): void;
|
|
507
|
+
static createSlot(name: string, parent?: ComponentBase): {
|
|
508
|
+
name: string;
|
|
509
|
+
children: ComponentBase[];
|
|
510
|
+
parent: ComponentBase | undefined;
|
|
511
|
+
mount(child: ComponentBase, options?: TransportOptions): void;
|
|
512
|
+
unmount(child: ComponentBase): void;
|
|
513
|
+
detachAll(): void;
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
interface VirtualizationDataRequest {
|
|
518
|
+
page: number;
|
|
519
|
+
pageSize: number;
|
|
520
|
+
scrollTop: number;
|
|
521
|
+
}
|
|
522
|
+
interface VirtualizationDataResponse<T> {
|
|
523
|
+
items: T[];
|
|
524
|
+
totalCount: number;
|
|
525
|
+
hasMore: boolean;
|
|
526
|
+
}
|
|
527
|
+
interface VirtualizationState<T> {
|
|
528
|
+
isLoading: boolean;
|
|
529
|
+
isInitialized: boolean;
|
|
530
|
+
currentPage: number;
|
|
531
|
+
totalCount: number;
|
|
532
|
+
hasMore: boolean;
|
|
533
|
+
error?: Error;
|
|
534
|
+
data: T[];
|
|
535
|
+
}
|
|
536
|
+
interface VirtualizationProps<T> {
|
|
537
|
+
dataRequest: (request: VirtualizationDataRequest) => Promise<VirtualizationDataResponse<T>>;
|
|
538
|
+
itemTemplate: (item: T, index: number) => any;
|
|
539
|
+
itemHeight: number | ((item: T, index: number) => number);
|
|
540
|
+
pageSize?: number;
|
|
541
|
+
renderMode?: 'item' | 'page';
|
|
542
|
+
mainTemplate?: (content: Component, state: VirtualizationState<T>) => any;
|
|
543
|
+
loadingTemplate?: (state: VirtualizationState<T>) => any;
|
|
544
|
+
emptyTemplate?: () => any;
|
|
545
|
+
errorTemplate?: (error: Error) => any;
|
|
546
|
+
overscan?: number;
|
|
547
|
+
autoLoad?: boolean;
|
|
548
|
+
autoLoadThreshold?: number;
|
|
549
|
+
overscanPages?: number;
|
|
550
|
+
pageBuffer?: number;
|
|
551
|
+
className?: string;
|
|
552
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
553
|
+
filter?: (item: T[]) => T[];
|
|
554
|
+
cacheSize?: number;
|
|
555
|
+
autoRefresh?: boolean;
|
|
556
|
+
watch?: () => unknown;
|
|
557
|
+
}
|
|
558
|
+
declare class Virtualization<T = any> extends Component<HTMLDivElement, VirtualizationProps<T>> {
|
|
559
|
+
private readonly _state;
|
|
560
|
+
private _virtualContent;
|
|
561
|
+
private _topSpacer;
|
|
562
|
+
private _bottomSpacer;
|
|
563
|
+
private _cache;
|
|
564
|
+
private _view;
|
|
565
|
+
private _occurrence;
|
|
566
|
+
private _occurrenceKeys;
|
|
567
|
+
private _isLoadingMore;
|
|
568
|
+
private _emptyRendered;
|
|
569
|
+
private _renderPending;
|
|
570
|
+
constructor(props: VirtualizationProps<T>);
|
|
571
|
+
contentWrapper: Component<any, any>;
|
|
572
|
+
wrapper: Component;
|
|
573
|
+
private _makeView;
|
|
574
|
+
private _initialLoadStarted;
|
|
575
|
+
onBuilding(): void;
|
|
576
|
+
onMounted(): void;
|
|
577
|
+
onDisposing(): void;
|
|
578
|
+
private _offsets;
|
|
579
|
+
private _resizeObserver?;
|
|
580
|
+
private _observed?;
|
|
581
|
+
private _observedHeight;
|
|
582
|
+
private _fixedHeight;
|
|
583
|
+
private _computeOffsets;
|
|
584
|
+
private _layoutOffsets;
|
|
585
|
+
private _offsetOf;
|
|
586
|
+
private _indexAt;
|
|
587
|
+
private _observeResize;
|
|
588
|
+
private _stopResizeObserver;
|
|
589
|
+
private _loadSeq;
|
|
590
|
+
private _dataWatchStop?;
|
|
591
|
+
private _reloadScheduled;
|
|
592
|
+
private _reloadTimes;
|
|
593
|
+
private _stopDataWatch;
|
|
594
|
+
/**
|
|
595
|
+
* dataRequest'i çağırır. `watch` açıksa çağrının senkron kısmında okunan reaktif veriyi izler;
|
|
596
|
+
* değişince yeniden yükleme planlar. Aksi hâlde çağrı hiçbir dış effect'e bağımlılık sızdırmaz.
|
|
597
|
+
*/
|
|
598
|
+
private _request;
|
|
599
|
+
private _scheduleReload;
|
|
600
|
+
/** Yüklü aralığı (0..currentPage) tek istekte yeniden alır; içerik yanıt gelene kadar kalır. */
|
|
601
|
+
private _reloadLoaded;
|
|
602
|
+
private _handleScroll;
|
|
603
|
+
private _loadInitial;
|
|
604
|
+
private _loadMore;
|
|
605
|
+
private _rebuildView;
|
|
606
|
+
private _clearContent;
|
|
607
|
+
private renderViewport;
|
|
608
|
+
private _occurrenceKey;
|
|
609
|
+
private _rowFor;
|
|
610
|
+
private _detachRow;
|
|
611
|
+
private _evictCache;
|
|
612
|
+
private _renderLoadingState;
|
|
613
|
+
private _renderEmptyState;
|
|
614
|
+
private _renderErrorState;
|
|
615
|
+
refresh(): Promise<void>;
|
|
616
|
+
setData(data: T[]): void;
|
|
617
|
+
scrollToIndex(index: number): void;
|
|
618
|
+
getState(): Readonly<VirtualizationState<T>>;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
declare const dom: {
|
|
622
|
+
readonly window: any;
|
|
623
|
+
document: any;
|
|
624
|
+
createElement(tagName: string, options?: any): any;
|
|
625
|
+
createDocumentFragment(): any;
|
|
626
|
+
createComment(content: any): any;
|
|
627
|
+
createTextNode(content: any): any;
|
|
628
|
+
querySelectorAll(selectors: string): any;
|
|
629
|
+
createElementNS(namepsaceUri: string, tagName: string, options?: any): any;
|
|
630
|
+
convertToSvgElement(element: Element): Element;
|
|
631
|
+
readonly body: any;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
declare class ControlCollection {
|
|
635
|
+
private owner;
|
|
636
|
+
constructor(owner: ComponentBase);
|
|
637
|
+
items: ComponentBase[];
|
|
638
|
+
add(...control: ComponentBase[]): ComponentBase[];
|
|
639
|
+
add(index?: number, ...control: ComponentBase[]): ComponentBase[];
|
|
640
|
+
insert(index?: number, ...controls: ComponentBase[]): ComponentBase[];
|
|
641
|
+
remove(control: ComponentBase): void;
|
|
642
|
+
detach(control: ComponentBase): Promise<void>;
|
|
643
|
+
silentDetach(control: ComponentBase, unlinkOnly?: boolean): void;
|
|
644
|
+
silentUnlink(control: ComponentBase): void;
|
|
645
|
+
clearAsync(): Promise<void>;
|
|
646
|
+
clear(): void;
|
|
647
|
+
get length(): number;
|
|
648
|
+
forEach(callbackfn: (value: ComponentBase, index: number, array: ComponentBase[]) => void): void;
|
|
649
|
+
map(callbackfn: (value: ComponentBase, index: number, array: ComponentBase[]) => void): void[];
|
|
650
|
+
onAdd?: (control: ComponentBase) => void;
|
|
651
|
+
onRemove?: (control: ComponentBase) => void;
|
|
652
|
+
onAddBeforeBuild?: (control: ComponentBase) => void;
|
|
653
|
+
move(control: ComponentBase, before?: ComponentBase | null): void;
|
|
654
|
+
moveToIndex(control: ComponentBase, index: number): void;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
declare class NameValuePair<KType, VType> {
|
|
658
|
+
Key: KType;
|
|
659
|
+
value: VType;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
declare class List<T> {
|
|
663
|
+
ItemAdded: (i: T) => void;
|
|
664
|
+
ItemAddedBefore: (i: T) => void;
|
|
665
|
+
ItemSplice: (start: any, i: T) => void;
|
|
666
|
+
private __list;
|
|
667
|
+
private _map;
|
|
668
|
+
Dispose(): void;
|
|
669
|
+
Add(item: T): number;
|
|
670
|
+
AddBefore(item: T): number;
|
|
671
|
+
Insert(start: any, item: T): T[];
|
|
672
|
+
get items(): Array<T>;
|
|
673
|
+
clear(): T[];
|
|
674
|
+
get count(): number;
|
|
675
|
+
remove(item: T): T[];
|
|
676
|
+
indexOf(item: T): number;
|
|
677
|
+
FindFromKey(key: any, value: any): T[];
|
|
678
|
+
removeIndex(index: number): T[];
|
|
679
|
+
has(item: T): boolean;
|
|
680
|
+
item(index: number): T;
|
|
681
|
+
forEach(callbackfn: (value: T, index: number, array: T[]) => void): void;
|
|
682
|
+
ReverseClone(): Array<T>;
|
|
683
|
+
filter(callbackfn: (value: T, index: number, array: T[]) => boolean): Array<T>;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
declare function toDisposable(fn: () => void): IDisposable;
|
|
687
|
+
|
|
688
|
+
declare class ErrorHandler {
|
|
689
|
+
private unexpectedErrorHandler;
|
|
690
|
+
private listeners;
|
|
691
|
+
private _isDevelopment;
|
|
692
|
+
private _enableConsoleLogging;
|
|
693
|
+
setDevelopmentMode(isDev: boolean): void;
|
|
694
|
+
setConsoleLogging(enabled: boolean): void;
|
|
695
|
+
isDevelopment(): boolean;
|
|
696
|
+
reportSuppressed(context: string, error: any): void;
|
|
697
|
+
report(error: Error): void;
|
|
698
|
+
private logIfDev;
|
|
699
|
+
private serializeError;
|
|
700
|
+
addListener(listener: (error: any) => void): () => void;
|
|
701
|
+
private emit;
|
|
702
|
+
setUnexpectedErrorHandler(handler: (e: any) => void): void;
|
|
703
|
+
getUnexpectedErrorHandler(): (e: any) => void;
|
|
704
|
+
onUnexpectedError(error: any): void;
|
|
705
|
+
safeCall<T>(fn: () => T, context: string, fallback?: T): T | undefined;
|
|
706
|
+
safeCallAsync<T>(fn: () => Promise<T>, context: string, fallback?: T): Promise<T | undefined>;
|
|
707
|
+
safeCallSilent(fn: () => void, context: string): void;
|
|
708
|
+
safeCallSilentAsync<T>(fn: () => Promise<T>, context: string): Promise<T | undefined>;
|
|
709
|
+
wrapSafe<TArgs extends any[], TReturn>(fn: (...args: TArgs) => TReturn, context: string): (...args: TArgs) => TReturn | undefined;
|
|
710
|
+
wrapSafeAsync<TArgs extends any[], TReturn>(fn: (...args: TArgs) => Promise<TReturn>, context: string): (...args: TArgs) => Promise<TReturn | undefined>;
|
|
711
|
+
}
|
|
712
|
+
declare const errorHandler: ErrorHandler;
|
|
713
|
+
declare function safeCall<T>(fn: () => T, context: string, fallback?: T): T | undefined;
|
|
714
|
+
declare function safeCallAsync<T>(fn: () => Promise<T>, context: string, fallback?: T): Promise<T | undefined>;
|
|
715
|
+
declare function safeCallSilent<T>(fn: () => T, context: string): void;
|
|
716
|
+
declare function setUnexpectedErrorHandler(handler: (e: any) => void): void;
|
|
717
|
+
|
|
718
|
+
declare class Dictionary<KType, VType> {
|
|
719
|
+
private __values;
|
|
720
|
+
Add(Key: KType, Value: VType): number;
|
|
721
|
+
has(key: KType): boolean;
|
|
722
|
+
item(key: KType): NameValuePair<KType, VType>;
|
|
723
|
+
OnItemAdded: (key: KType, value: VType) => any;
|
|
724
|
+
removeIndex(index: number): NameValuePair<KType, VType>[];
|
|
725
|
+
remove(Key: KType): void;
|
|
726
|
+
clear(): void;
|
|
727
|
+
forEach(callback: ((item: NameValuePair<KType, VType>) => void)): void;
|
|
728
|
+
get values(): List<NameValuePair<KType, VType>>;
|
|
729
|
+
filter(callbackfn: (value: NameValuePair<KType, VType>, index: number, array: NameValuePair<KType, VType>[]) => boolean): NameValuePair<KType, VType>[];
|
|
730
|
+
find(predicate: (value: NameValuePair<KType, VType>, index: number, obj: NameValuePair<KType, VType>[]) => unknown, thisArg?: any): NameValuePair<KType, VType> | undefined;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
interface IAttribute<BaseType> {
|
|
734
|
+
add(attribute: object | string): BaseType;
|
|
735
|
+
remove(key: string): BaseType;
|
|
736
|
+
has(key: string): boolean;
|
|
737
|
+
get(key: string): string | null;
|
|
738
|
+
}
|
|
739
|
+
interface IClass<BaseType> {
|
|
740
|
+
add(...values: (string | any[] | {} | Function)[]): BaseType;
|
|
741
|
+
remove(classNames: string[] | string): BaseType;
|
|
742
|
+
has(className: string): boolean;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
declare class LinkedList<T> {
|
|
746
|
+
private _ring;
|
|
747
|
+
private _count;
|
|
748
|
+
get size(): number;
|
|
749
|
+
isEmpty(): boolean;
|
|
750
|
+
push(value: T): () => void;
|
|
751
|
+
unshift(value: T): () => void;
|
|
752
|
+
pop(): T | undefined;
|
|
753
|
+
shift(): T | undefined;
|
|
754
|
+
clear(): void;
|
|
755
|
+
[Symbol.iterator](): Iterator<T>;
|
|
756
|
+
private _link;
|
|
757
|
+
private _take;
|
|
758
|
+
private _unlink;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
type Bind<T> = T | (() => T);
|
|
762
|
+
declare function toGetter<T>(value: Bind<T>): () => T;
|
|
763
|
+
declare function read<T>(value: Bind<T>): T;
|
|
764
|
+
|
|
765
|
+
interface Group<TKey, TElement> {
|
|
766
|
+
key: TKey;
|
|
767
|
+
items: TElement[];
|
|
768
|
+
}
|
|
769
|
+
declare class Query<T> implements Iterable<T> {
|
|
770
|
+
private readonly source;
|
|
771
|
+
constructor(source: Iterable<T>);
|
|
772
|
+
static from<T>(source: Iterable<T>): Query<T>;
|
|
773
|
+
where(predicate: (item: T, index: number) => boolean): Query<T>;
|
|
774
|
+
select<TResult>(selector: (item: T, index: number) => TResult): Query<TResult>;
|
|
775
|
+
orderBy<TKey>(keySelector: (item: T) => TKey): Query<T>;
|
|
776
|
+
orderByDescending<TKey>(keySelector: (item: T) => TKey): Query<T>;
|
|
777
|
+
distinctBy<TKey>(keySelector: (item: T) => TKey): Query<T>;
|
|
778
|
+
groupBy<TKey>(keySelector: (item: T) => TKey): Query<Group<TKey, T>>;
|
|
779
|
+
first(): T;
|
|
780
|
+
firstOrDefault(): T | undefined;
|
|
781
|
+
any(predicate?: (item: T) => boolean): boolean;
|
|
782
|
+
all(predicate: (item: T) => boolean): boolean;
|
|
783
|
+
aggregate<TResult>(seed: TResult, func: (acc: TResult, item: T) => TResult): TResult;
|
|
784
|
+
toArray(): T[];
|
|
785
|
+
[Symbol.iterator](): Iterator<T>;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
declare const motifMessages: {
|
|
789
|
+
MJX101: (tag: string) => string;
|
|
790
|
+
MJX102: (description: string) => string;
|
|
791
|
+
MJX103: (tag: string) => string;
|
|
792
|
+
MJX104: () => string;
|
|
793
|
+
MJX105: () => string;
|
|
794
|
+
MJX106: () => string;
|
|
795
|
+
MJX107: () => string;
|
|
796
|
+
MJX108: () => string;
|
|
797
|
+
MJX109: () => string;
|
|
798
|
+
MJX110: (ms: number) => string;
|
|
799
|
+
MJX111: () => string;
|
|
800
|
+
MJX112: (depth: number) => string;
|
|
801
|
+
MJX113: () => string;
|
|
802
|
+
MJX114: () => string;
|
|
803
|
+
MJX115: () => string;
|
|
804
|
+
MJX116: (ms: number) => string;
|
|
805
|
+
MJX117: () => string;
|
|
806
|
+
MJX118: () => string;
|
|
807
|
+
MJX119: () => string;
|
|
808
|
+
MJX120: () => string;
|
|
809
|
+
MJX121: (compiled: number, runtime: number) => string;
|
|
810
|
+
MJX122: (hook: string) => string;
|
|
811
|
+
MJX123: (event: string) => string;
|
|
812
|
+
MJX201: () => string;
|
|
813
|
+
MJX202: (key: unknown, index: number) => string;
|
|
814
|
+
MJX203: (max: number) => string;
|
|
815
|
+
MJX204: () => string;
|
|
816
|
+
MJX205: () => string;
|
|
817
|
+
MJX206: () => string;
|
|
818
|
+
MJX207: () => string;
|
|
819
|
+
MJX208: () => string;
|
|
820
|
+
MJX301: (outlet: string, ms: number) => string;
|
|
821
|
+
MJX302: (name: string) => string;
|
|
822
|
+
MJX303: (chain: string) => string;
|
|
823
|
+
MJX304: () => string;
|
|
824
|
+
MJX305: () => string;
|
|
825
|
+
MJX306: (hook: string) => string;
|
|
826
|
+
MJX307: () => string;
|
|
827
|
+
MJX308: () => string;
|
|
828
|
+
MJX309: () => string;
|
|
829
|
+
MJX310: (parentPath: string) => string;
|
|
830
|
+
MJX311: (path: string, parentPath: string) => string;
|
|
831
|
+
MJX312: (full: string) => string;
|
|
832
|
+
MJX313: (full: string) => string;
|
|
833
|
+
MJX314: (alias: string, parentPath: string) => string;
|
|
834
|
+
MJX315: (alias: string) => string;
|
|
835
|
+
MJX316: (alias: string) => string;
|
|
836
|
+
MJX401: (token: string) => string;
|
|
837
|
+
MJX402: (token: string) => string;
|
|
838
|
+
MJX403: () => string;
|
|
839
|
+
MJX404: (chain: string) => string;
|
|
840
|
+
MJX405: () => string;
|
|
841
|
+
MJX406: (selector: string) => string;
|
|
842
|
+
MJX407: (token: string) => string;
|
|
843
|
+
MJX408: (token: string, reason: string) => string;
|
|
844
|
+
MJX409: (token: string) => string;
|
|
845
|
+
MJX410: (token: string, sources: string) => string;
|
|
846
|
+
MJX411: (token: string) => string;
|
|
847
|
+
MJX413: (token: string) => string;
|
|
848
|
+
MJX414: (token: string, reason: string) => string;
|
|
849
|
+
MJX501: () => string;
|
|
850
|
+
MJX502: () => string;
|
|
851
|
+
MJX503: () => string;
|
|
852
|
+
MJX504: () => string;
|
|
853
|
+
MJX505: () => string;
|
|
854
|
+
MJX507: (name: string, limit: number, count: number) => string;
|
|
855
|
+
MJX601: () => string;
|
|
856
|
+
MJX602: () => string;
|
|
857
|
+
MJX603: () => string;
|
|
858
|
+
MJX604: () => string;
|
|
859
|
+
MJX605: () => string;
|
|
860
|
+
MJX607: () => string;
|
|
861
|
+
MJX608: () => string;
|
|
862
|
+
MJX609: () => string;
|
|
863
|
+
MJX610: () => string;
|
|
864
|
+
MJX611: () => string;
|
|
865
|
+
};
|
|
866
|
+
type MotifErrorCode = keyof typeof motifMessages;
|
|
867
|
+
declare class MotifError extends Error {
|
|
868
|
+
readonly code: MotifErrorCode;
|
|
869
|
+
constructor(code: MotifErrorCode, message: string, options?: {
|
|
870
|
+
cause?: unknown;
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
declare function motifCompiled(contract: number): void;
|
|
875
|
+
|
|
876
|
+
declare enum NodeTypes {
|
|
877
|
+
ELEMENT_NODE = 1,
|
|
878
|
+
ATTRIBUTE_NODE = 2,
|
|
879
|
+
TEXT_NODE = 3,
|
|
880
|
+
CDATA_SECTION_NODE = 4,
|
|
881
|
+
ENTITY_REFERENCE_NODE = 5,
|
|
882
|
+
/**deprecated */
|
|
883
|
+
ENTITY_NODE = 6,
|
|
884
|
+
/**deprecated */
|
|
885
|
+
PROCESSING_INSTRUCTION_NODE = 7,
|
|
886
|
+
COMMENT_NODE = 8,
|
|
887
|
+
DOCUMENT_NODE = 9,
|
|
888
|
+
DOCUMENT_TYPE_NODE = 10,
|
|
889
|
+
DOCUMENT_FRAGMENT_NODE = 11,
|
|
890
|
+
/**deprecated */
|
|
891
|
+
NOTATION_NODE = 12
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
declare class Signal<T> {
|
|
895
|
+
private _value;
|
|
896
|
+
private readonly _target;
|
|
897
|
+
private readonly _key;
|
|
898
|
+
private readonly _equals;
|
|
899
|
+
private _disposed;
|
|
900
|
+
static create<U>(initialValue: U, equals?: (a: U, b: U) => boolean): Signal<U>;
|
|
901
|
+
constructor(initialValue: T, equals?: (a: T, b: T) => boolean);
|
|
902
|
+
get value(): T;
|
|
903
|
+
set value(newValue: T);
|
|
904
|
+
peek(): T;
|
|
905
|
+
update(updater: (prev: T) => T): void;
|
|
906
|
+
mutate(mutator: (draft: T) => void): void;
|
|
907
|
+
notify(): void;
|
|
908
|
+
asReadonly(): ReadonlySignal<T>;
|
|
909
|
+
dispose(): void;
|
|
910
|
+
valueOf(): T;
|
|
911
|
+
toString(): string;
|
|
912
|
+
}
|
|
913
|
+
interface ReadonlySignal<T> {
|
|
914
|
+
readonly value: T;
|
|
915
|
+
peek(): T;
|
|
916
|
+
valueOf(): T;
|
|
917
|
+
toString(): string;
|
|
918
|
+
}
|
|
919
|
+
declare class Computed<T> {
|
|
920
|
+
private _value;
|
|
921
|
+
private _dirty;
|
|
922
|
+
private _computing;
|
|
923
|
+
private readonly _target;
|
|
924
|
+
private readonly _key;
|
|
925
|
+
private readonly _getter;
|
|
926
|
+
private _cleanup?;
|
|
927
|
+
constructor(getter: () => T);
|
|
928
|
+
get value(): T;
|
|
929
|
+
peek(): T;
|
|
930
|
+
dispose(): void;
|
|
931
|
+
valueOf(): T;
|
|
932
|
+
toString(): string;
|
|
933
|
+
}
|
|
934
|
+
declare class LazyComputed<T> {
|
|
935
|
+
private _value;
|
|
936
|
+
private _dirty;
|
|
937
|
+
private _disposed;
|
|
938
|
+
private readonly _target;
|
|
939
|
+
private readonly _key;
|
|
940
|
+
private readonly _getter;
|
|
941
|
+
private readonly _runner;
|
|
942
|
+
constructor(getter: () => T);
|
|
943
|
+
get value(): T;
|
|
944
|
+
peek(): T;
|
|
945
|
+
get isDirty(): boolean;
|
|
946
|
+
private _refresh;
|
|
947
|
+
dispose(): void;
|
|
948
|
+
valueOf(): T;
|
|
949
|
+
toString(): string;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
type EffectFn = () => void;
|
|
953
|
+
declare class Effect {
|
|
954
|
+
fn: EffectFn;
|
|
955
|
+
private callback?;
|
|
956
|
+
deps: [object, string | symbol][];
|
|
957
|
+
active: boolean;
|
|
958
|
+
running: boolean;
|
|
959
|
+
scheduler?: () => void;
|
|
960
|
+
constructor(fn: EffectFn, callback?: ((value: unknown) => void) | undefined);
|
|
961
|
+
run(): void;
|
|
962
|
+
stop(): void;
|
|
963
|
+
}
|
|
964
|
+
declare function configureReactivityLeakMonitor(opts?: {
|
|
965
|
+
enabled?: boolean;
|
|
966
|
+
threshold?: number;
|
|
967
|
+
name?: string;
|
|
968
|
+
}): void;
|
|
969
|
+
declare function effect(fn: EffectFn, onValueChanged?: <T>(value: T) => void): () => void;
|
|
970
|
+
interface AsyncTrackingToken {
|
|
971
|
+
effect: Effect | undefined;
|
|
972
|
+
pushed: boolean;
|
|
973
|
+
}
|
|
974
|
+
declare const asyncTracking: {
|
|
975
|
+
capture(): AsyncTrackingToken;
|
|
976
|
+
suspend<T>(t: AsyncTrackingToken, value: T): T;
|
|
977
|
+
resume<T>(t: AsyncTrackingToken, value: T): T;
|
|
978
|
+
end(t: AsyncTrackingToken): void;
|
|
979
|
+
};
|
|
980
|
+
declare function untracked<T>(fn: () => T): T;
|
|
981
|
+
|
|
982
|
+
declare function reactive<T>(model: T): UnwrapValueRefs<T>;
|
|
983
|
+
declare function useModel<T>(model: T): UnwrapValueRefs<T>;
|
|
984
|
+
declare function clearModel(model: any): void;
|
|
985
|
+
declare function deepClone(item: any): any;
|
|
986
|
+
declare function createSignal<T>(initialValue: T): Signal<T>;
|
|
987
|
+
declare function createComputed<T>(getter: () => T): Computed<T>;
|
|
988
|
+
declare function createLazyComputed<T>(getter: () => T): LazyComputed<T>;
|
|
989
|
+
|
|
990
|
+
declare function inject<T>(token: abstract new (...args: any[]) => T): T;
|
|
991
|
+
declare function inject<T = any>(token: string | symbol | object): T;
|
|
992
|
+
declare class ServiceProvider {
|
|
993
|
+
private services;
|
|
994
|
+
private parent?;
|
|
995
|
+
private root;
|
|
996
|
+
private scopeName?;
|
|
997
|
+
private kind;
|
|
998
|
+
private singletonCache;
|
|
999
|
+
private scopedCache;
|
|
1000
|
+
private transientSet;
|
|
1001
|
+
private _autoDisposeTransients;
|
|
1002
|
+
private pendingSingleton;
|
|
1003
|
+
private pendingScoped;
|
|
1004
|
+
private _navigation?;
|
|
1005
|
+
private _ownerlessSlot;
|
|
1006
|
+
private _navigationDisposed;
|
|
1007
|
+
constructor(services: ServiceCollection, parent?: ServiceProvider, root?: ServiceProvider);
|
|
1008
|
+
createScope(name?: string): ServiceProvider;
|
|
1009
|
+
enableAutoDisposeTransients(enable?: boolean): this;
|
|
1010
|
+
get<T = any>(token: any): T;
|
|
1011
|
+
getAsync<T = any>(token: any): Promise<T>;
|
|
1012
|
+
getAllServices(): ServiceCollection;
|
|
1013
|
+
private _releaseIfUnused;
|
|
1014
|
+
private _scopeFor;
|
|
1015
|
+
private _handle;
|
|
1016
|
+
private _handleAsync;
|
|
1017
|
+
private _createHandle;
|
|
1018
|
+
private _isSystemScope;
|
|
1019
|
+
private _scopedInstanceSync;
|
|
1020
|
+
private _scopedInstanceAsync;
|
|
1021
|
+
private resolveDescriptorSync;
|
|
1022
|
+
private resolveDescriptorAsync;
|
|
1023
|
+
private construct;
|
|
1024
|
+
private instantiateSync;
|
|
1025
|
+
private instantiateAsyncIn;
|
|
1026
|
+
private instantiateAsync;
|
|
1027
|
+
dispose(): Promise<void>;
|
|
1028
|
+
private resolveDepsSync;
|
|
1029
|
+
private resolveDepsAsyncIn;
|
|
1030
|
+
private injectionResolver;
|
|
1031
|
+
private getDeps;
|
|
1032
|
+
private resolveTokenSync;
|
|
1033
|
+
private resolveTokenAsync;
|
|
1034
|
+
private checkCycle;
|
|
1035
|
+
private describeToken;
|
|
1036
|
+
private describeTokenWithSource;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
type ServiceLifetime = 'transient' | 'singleton' | 'scoped';
|
|
1040
|
+
type ServiceImplementation<V> = V extends abstract new (...args: any[]) => any ? V : V extends (...args: any[]) => any ? 'Use { useValue: fn } or { useFactory: fn } to register a function' : V;
|
|
1041
|
+
interface ServiceDescriptor<T = any> {
|
|
1042
|
+
token: any;
|
|
1043
|
+
lifetime: ServiceLifetime;
|
|
1044
|
+
useClass?: new (...args: any[]) => T;
|
|
1045
|
+
useFactory?: (...args: any[]) => T | Promise<T>;
|
|
1046
|
+
useValue?: T;
|
|
1047
|
+
deps?: any[];
|
|
1048
|
+
}
|
|
1049
|
+
declare class ServiceCollection {
|
|
1050
|
+
private descriptors;
|
|
1051
|
+
reset(): void;
|
|
1052
|
+
addTransient<V>(token: any, impl: ServiceImplementation<V>): void;
|
|
1053
|
+
addSingleton<V>(token: any, impl: ServiceImplementation<V>): void;
|
|
1054
|
+
addScoped<V>(token: any, impl: ServiceImplementation<V>): void;
|
|
1055
|
+
private _add;
|
|
1056
|
+
private _tokenName;
|
|
1057
|
+
getDescriptor(token: any): ServiceDescriptor | null;
|
|
1058
|
+
/** `@Injectable` ile işaretlenmiş ama henüz kaydedilmemiş bir token var mı? */
|
|
1059
|
+
canAutoRegister(token: any): boolean;
|
|
1060
|
+
getService(token: any): ServiceDescriptor | null;
|
|
1061
|
+
buildServiceProvider(): ServiceProvider;
|
|
1062
|
+
has(token: any): boolean;
|
|
1063
|
+
remove(token: any): boolean;
|
|
1064
|
+
replace<V>(token: any, impl: ServiceImplementation<V>, lifetime?: ServiceLifetime): void;
|
|
1065
|
+
tryAddTransient<V>(token: any, impl: ServiceImplementation<V>): boolean;
|
|
1066
|
+
tryAddSingleton<V>(token: any, impl: ServiceImplementation<V>): boolean;
|
|
1067
|
+
tryAddScoped<V>(token: any, impl: ServiceImplementation<V>): boolean;
|
|
1068
|
+
autoRegisterInjectables(): void;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
interface RouterValidateEventArgs {
|
|
1072
|
+
uri: string;
|
|
1073
|
+
key: any;
|
|
1074
|
+
routes: Map<any, RouteItem>;
|
|
1075
|
+
params: Record<string, any>;
|
|
1076
|
+
}
|
|
1077
|
+
type RouteControl = ComponentBase | (() => ComponentBase) | (() => Promise<ComponentBase>) | Promise<ComponentBase> | Promise<any> | any;
|
|
1078
|
+
type RedirectTarget = {
|
|
1079
|
+
path: string;
|
|
1080
|
+
params: Record<string, any>;
|
|
1081
|
+
meta: Record<string, any>;
|
|
1082
|
+
};
|
|
1083
|
+
type RouteRedirect = string | ((to: RedirectTarget) => string);
|
|
1084
|
+
type RouteItem = RouteItemBase & ({
|
|
1085
|
+
control: RouteControl;
|
|
1086
|
+
redirect?: RouteRedirect;
|
|
1087
|
+
} | {
|
|
1088
|
+
control?: RouteControl;
|
|
1089
|
+
redirect: RouteRedirect;
|
|
1090
|
+
});
|
|
1091
|
+
interface RouteItemBase {
|
|
1092
|
+
path: string;
|
|
1093
|
+
childs?: RouteItem[];
|
|
1094
|
+
extend?: Record<string, any>;
|
|
1095
|
+
meta?: Record<string, any>;
|
|
1096
|
+
keepAlive?: boolean;
|
|
1097
|
+
name?: string | null;
|
|
1098
|
+
validate?: (e: RouterValidateEventArgs) => boolean;
|
|
1099
|
+
onShow?: (e: ComponentBase) => void;
|
|
1100
|
+
onEntering?: (context: {
|
|
1101
|
+
path?: string;
|
|
1102
|
+
params?: Record<string, any>;
|
|
1103
|
+
meta?: Record<string, any>;
|
|
1104
|
+
to?: {
|
|
1105
|
+
path: string;
|
|
1106
|
+
params: Record<string, any>;
|
|
1107
|
+
meta: Record<string, any>;
|
|
1108
|
+
};
|
|
1109
|
+
}) => void | Promise<void>;
|
|
1110
|
+
onEnter?: (context: {
|
|
1111
|
+
path?: string;
|
|
1112
|
+
params?: Record<string, any>;
|
|
1113
|
+
meta?: Record<string, any>;
|
|
1114
|
+
to?: {
|
|
1115
|
+
path: string;
|
|
1116
|
+
params: Record<string, any>;
|
|
1117
|
+
meta: Record<string, any>;
|
|
1118
|
+
};
|
|
1119
|
+
}) => void | Promise<void>;
|
|
1120
|
+
onLeave?: (context: {
|
|
1121
|
+
from: {
|
|
1122
|
+
path: string;
|
|
1123
|
+
params: Record<string, any>;
|
|
1124
|
+
meta: Record<string, any>;
|
|
1125
|
+
};
|
|
1126
|
+
to: {
|
|
1127
|
+
path: string;
|
|
1128
|
+
params: Record<string, any>;
|
|
1129
|
+
meta: Record<string, any>;
|
|
1130
|
+
};
|
|
1131
|
+
}) => boolean | void | {
|
|
1132
|
+
cancel: true;
|
|
1133
|
+
reason?: string;
|
|
1134
|
+
} | Promise<boolean | void | {
|
|
1135
|
+
cancel: true;
|
|
1136
|
+
reason?: string;
|
|
1137
|
+
}>;
|
|
1138
|
+
onUpdate?: (context: {
|
|
1139
|
+
from: {
|
|
1140
|
+
path: string;
|
|
1141
|
+
params: Record<string, any>;
|
|
1142
|
+
};
|
|
1143
|
+
to: {
|
|
1144
|
+
path: string;
|
|
1145
|
+
params: Record<string, any>;
|
|
1146
|
+
};
|
|
1147
|
+
meta: Record<string, any>;
|
|
1148
|
+
}) => void | Promise<void>;
|
|
1149
|
+
alias?: string | string[];
|
|
1150
|
+
fullPath?: string | null;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
type RouteResolveContext = {
|
|
1154
|
+
uri: string;
|
|
1155
|
+
context: Application;
|
|
1156
|
+
rewritePath: (uri: string) => void;
|
|
1157
|
+
};
|
|
1158
|
+
type NavigationDirection = 'initial' | 'push' | 'replace' | 'back' | 'forward' | 'traverse';
|
|
1159
|
+
type NavigationOptions = {
|
|
1160
|
+
replace?: boolean;
|
|
1161
|
+
state?: any;
|
|
1162
|
+
force?: boolean;
|
|
1163
|
+
scroll?: 'top' | 'smooth' | 'instant' | {
|
|
1164
|
+
top?: number;
|
|
1165
|
+
left?: number;
|
|
1166
|
+
behavior?: ScrollBehavior;
|
|
1167
|
+
};
|
|
1168
|
+
};
|
|
1169
|
+
type ScrollMemoryOptions = {
|
|
1170
|
+
top?: boolean;
|
|
1171
|
+
anchor?: boolean;
|
|
1172
|
+
settleMs?: number;
|
|
1173
|
+
persist?: boolean;
|
|
1174
|
+
limit?: number;
|
|
1175
|
+
key?: (path: string) => string;
|
|
1176
|
+
container?: string | HTMLElement | (() => HTMLElement | null | undefined);
|
|
1177
|
+
};
|
|
1178
|
+
type StackTransitionContext = {
|
|
1179
|
+
direction: NavigationDirection;
|
|
1180
|
+
entering: HTMLElement | null;
|
|
1181
|
+
leaving: HTMLElement | null;
|
|
1182
|
+
};
|
|
1183
|
+
type StackSwipeBackOptions = {
|
|
1184
|
+
edge?: number;
|
|
1185
|
+
threshold?: number;
|
|
1186
|
+
};
|
|
1187
|
+
type StackOptions = {
|
|
1188
|
+
retain?: boolean;
|
|
1189
|
+
depth?: number;
|
|
1190
|
+
persist?: boolean;
|
|
1191
|
+
animation?: 'none' | 'slide' | ((context: StackTransitionContext) => Promise<void> | void);
|
|
1192
|
+
duration?: number;
|
|
1193
|
+
swipeBack?: boolean | StackSwipeBackOptions;
|
|
1194
|
+
};
|
|
1195
|
+
type StackEntryInfo = {
|
|
1196
|
+
index: number;
|
|
1197
|
+
uri: string;
|
|
1198
|
+
current: boolean;
|
|
1199
|
+
retained: boolean;
|
|
1200
|
+
};
|
|
1201
|
+
type RouterOptions = {
|
|
1202
|
+
mode?: 'history' | 'hash' | 'file' | 'shell';
|
|
1203
|
+
fallbacks?: {
|
|
1204
|
+
notFound?: any;
|
|
1205
|
+
error?: any;
|
|
1206
|
+
};
|
|
1207
|
+
middlewareCollections?: () => Array<(ctx: RouteResolveContext, next: () => Promise<void>) => any>;
|
|
1208
|
+
RouteItems: RouteItem[];
|
|
1209
|
+
hooks?: RouterEvents;
|
|
1210
|
+
scrollMemory?: boolean | ScrollMemoryOptions;
|
|
1211
|
+
stack?: boolean | StackOptions;
|
|
1212
|
+
};
|
|
1213
|
+
interface ResolveResult {
|
|
1214
|
+
ok: boolean;
|
|
1215
|
+
uri: string;
|
|
1216
|
+
fullPath: string | null;
|
|
1217
|
+
route: RouteItem | null;
|
|
1218
|
+
chain: RouteItem[];
|
|
1219
|
+
params: Record<string, any>;
|
|
1220
|
+
extend: Record<string, any>;
|
|
1221
|
+
meta?: Record<string, any>;
|
|
1222
|
+
aliasOf?: string | null;
|
|
1223
|
+
}
|
|
1224
|
+
type Router = {
|
|
1225
|
+
readonly params: Record<string, any>;
|
|
1226
|
+
readonly route: RouteItem | null;
|
|
1227
|
+
readonly ok: boolean;
|
|
1228
|
+
readonly uri: string;
|
|
1229
|
+
readonly fullPath: string | null;
|
|
1230
|
+
readonly aliasOf: string | null;
|
|
1231
|
+
navigate: (uri: string, options?: NavigationOptions) => Promise<void>;
|
|
1232
|
+
navigateByName: (name: string, params?: Record<string, any>, options?: NavigationOptions) => Promise<void>;
|
|
1233
|
+
evict: (route?: RouteItem | string | null) => Promise<void>;
|
|
1234
|
+
readonly chain: string[];
|
|
1235
|
+
readonly extend: Record<string, any>;
|
|
1236
|
+
readonly meta: Record<string, any>;
|
|
1237
|
+
readonly direction?: NavigationDirection;
|
|
1238
|
+
readonly state?: any;
|
|
1239
|
+
readonly stack?: StackEntryInfo[];
|
|
1240
|
+
resolve: (uri: string) => ResolveResult;
|
|
1241
|
+
href: (name: string, params?: Record<string, any>) => string;
|
|
1242
|
+
readonly routes: RouteInfo[];
|
|
1243
|
+
};
|
|
1244
|
+
type RouteInfo = {
|
|
1245
|
+
fullPath: string;
|
|
1246
|
+
name: string | null;
|
|
1247
|
+
meta: Record<string, any>;
|
|
1248
|
+
route: RouteItem;
|
|
1249
|
+
chain: RouteItem[];
|
|
1250
|
+
};
|
|
1251
|
+
/** `motifjs-router-navigated` olayının (`app.onRouterChanged`) yükü. */
|
|
1252
|
+
type RouterNavigatedEventArgs = {
|
|
1253
|
+
uri: string;
|
|
1254
|
+
params: Record<string, any>;
|
|
1255
|
+
meta: Record<string, any>;
|
|
1256
|
+
route: RouteItem | null;
|
|
1257
|
+
ok: boolean;
|
|
1258
|
+
/** Açılış (ilk) navigasyonu mu? */
|
|
1259
|
+
initial: boolean;
|
|
1260
|
+
redirectedFrom?: string;
|
|
1261
|
+
direction?: NavigationDirection;
|
|
1262
|
+
state?: any;
|
|
1263
|
+
};
|
|
1264
|
+
type RouterEvents = {
|
|
1265
|
+
onEntering?: RouteItem['onEntering'];
|
|
1266
|
+
onEnter?: RouteItem['onEnter'];
|
|
1267
|
+
onLeave?: RouteItem['onLeave'];
|
|
1268
|
+
onUpdate?: RouteItem['onUpdate'];
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
interface RouterViewProps extends IBaseProp<{
|
|
1272
|
+
name?: string;
|
|
1273
|
+
}> {
|
|
1274
|
+
}
|
|
1275
|
+
declare class RouterView extends Component {
|
|
1276
|
+
constructor(props: IBaseProp<RouterViewProps>);
|
|
1277
|
+
get scopeId(): string;
|
|
1278
|
+
disposingChilds: boolean;
|
|
1279
|
+
previouspage: any;
|
|
1280
|
+
current: ComponentBase | ComponentBase[] | null;
|
|
1281
|
+
isBusy: boolean;
|
|
1282
|
+
navigate(page: ComponentBase | ComponentBase[], keepOldControl?: boolean): Promise<void>;
|
|
1283
|
+
disposeTarget(target: ComponentBase | ComponentBase[] | null): Promise<void>;
|
|
1284
|
+
onBuilt(): void;
|
|
1285
|
+
onDisposed(): void;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
type RouterLinkOptions = {
|
|
1289
|
+
to: string;
|
|
1290
|
+
el?: string | Node;
|
|
1291
|
+
showHref?: boolean;
|
|
1292
|
+
text?: string;
|
|
1293
|
+
exactClass?: string;
|
|
1294
|
+
activeClass?: string;
|
|
1295
|
+
bypass?: boolean;
|
|
1296
|
+
target?: string;
|
|
1297
|
+
onExact?: () => void;
|
|
1298
|
+
offExact?: () => void;
|
|
1299
|
+
onActive?: () => void;
|
|
1300
|
+
offActive?: () => void;
|
|
1301
|
+
};
|
|
1302
|
+
declare class RouterLink extends Component<any, RouterLinkOptions> {
|
|
1303
|
+
constructor(props: RouterLinkOptions);
|
|
1304
|
+
onBuilt(sender: ComponentBase, e: EventArgs): void;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
declare class ApplicationBuilder {
|
|
1308
|
+
services: ServiceCollection;
|
|
1309
|
+
constructor();
|
|
1310
|
+
build(): Application;
|
|
1311
|
+
rebuild(): Application;
|
|
1312
|
+
}
|
|
1313
|
+
interface ApplicationEvents {
|
|
1314
|
+
'router-changed': 'motifjs-router-navigated';
|
|
1315
|
+
}
|
|
1316
|
+
type AppLifecycleState = 'visible' | 'hidden' | 'frozen' | 'resumed' | 'restored' | 'online' | 'offline';
|
|
1317
|
+
type AppLifecycleEventArgs = {
|
|
1318
|
+
state: AppLifecycleState;
|
|
1319
|
+
visible: boolean;
|
|
1320
|
+
online: boolean;
|
|
1321
|
+
};
|
|
1322
|
+
type NavigationGuardContext = {
|
|
1323
|
+
to: {
|
|
1324
|
+
path: string;
|
|
1325
|
+
params: Record<string, any>;
|
|
1326
|
+
meta: Record<string, any>;
|
|
1327
|
+
options?: NavigationOptions;
|
|
1328
|
+
redirectedFrom?: string;
|
|
1329
|
+
direction?: NavigationDirection;
|
|
1330
|
+
state?: any;
|
|
1331
|
+
};
|
|
1332
|
+
from: {
|
|
1333
|
+
path: string;
|
|
1334
|
+
params: Record<string, any>;
|
|
1335
|
+
meta: Record<string, any>;
|
|
1336
|
+
options?: NavigationOptions;
|
|
1337
|
+
} | null;
|
|
1338
|
+
};
|
|
1339
|
+
type NavigationGuard = (context: NavigationGuardContext, next: (redirect?: string | false) => void) => void | Promise<void>;
|
|
1340
|
+
declare class Application {
|
|
1341
|
+
provider: ServiceProvider;
|
|
1342
|
+
static get main(): Application;
|
|
1343
|
+
constructor(provider: ServiceProvider);
|
|
1344
|
+
private _middlewares;
|
|
1345
|
+
private _beforeEachGuards;
|
|
1346
|
+
readonly router: Router;
|
|
1347
|
+
private events;
|
|
1348
|
+
static CreateBuilder(): ApplicationBuilder;
|
|
1349
|
+
private appShell;
|
|
1350
|
+
getAppShell(): Component;
|
|
1351
|
+
run(host: HTMLElement | string | Node, appRoot?: any): void;
|
|
1352
|
+
insert(component: Component): void;
|
|
1353
|
+
remove(component: Component): void;
|
|
1354
|
+
attach(component: Component): void;
|
|
1355
|
+
detach(component: Component): void;
|
|
1356
|
+
appendToMainHost(component: Node): void;
|
|
1357
|
+
dispose(): void;
|
|
1358
|
+
use(callback: (ctx: RouteResolveContext, next: () => Promise<void>) => any): Application;
|
|
1359
|
+
useGuard(guard: NavigationGuard): Application;
|
|
1360
|
+
private urlRoutingModule;
|
|
1361
|
+
private _routerConfig;
|
|
1362
|
+
private _routerRoot;
|
|
1363
|
+
private _startedRouter;
|
|
1364
|
+
useRouter(options: RouteItem[] | {
|
|
1365
|
+
routes: RouteItem[];
|
|
1366
|
+
mode?: 'history' | 'hash' | 'file' | 'shell';
|
|
1367
|
+
fallbacks?: {
|
|
1368
|
+
notFound?: any;
|
|
1369
|
+
error?: any;
|
|
1370
|
+
};
|
|
1371
|
+
hooks?: RouterEvents;
|
|
1372
|
+
scrollMemory?: boolean | ScrollMemoryOptions;
|
|
1373
|
+
stack?: boolean | StackOptions;
|
|
1374
|
+
}): Application;
|
|
1375
|
+
restartRouter(): this;
|
|
1376
|
+
navigate(uri: string, options?: NavigationOptions): Promise<any>;
|
|
1377
|
+
navigateByName(name: string, params?: Record<string, any>, options?: NavigationOptions): Promise<any>;
|
|
1378
|
+
on<T>(event: ApplicationEvents[keyof ApplicationEvents & string] | any, handler: (args?: T) => void): any;
|
|
1379
|
+
off<T>(event: any, handler: (args?: T) => void): void;
|
|
1380
|
+
fire<T>(event: any, args?: T): void;
|
|
1381
|
+
onRouterChanged(handler: (args?: RouterNavigatedEventArgs) => unknown): any;
|
|
1382
|
+
get isVisible(): boolean;
|
|
1383
|
+
get isOnline(): boolean;
|
|
1384
|
+
private _lifecycleOff;
|
|
1385
|
+
onLifecycle(handler: (args?: AppLifecycleEventArgs) => unknown): () => void;
|
|
1386
|
+
private _emitLifecycle;
|
|
1387
|
+
private _installLifecycleListeners;
|
|
1388
|
+
private _removeLifecycleListeners;
|
|
1389
|
+
private _isDevelopment;
|
|
1390
|
+
private _enableErrorLogging;
|
|
1391
|
+
get isDevelopmentModeEnabled(): boolean;
|
|
1392
|
+
/** Enable reactive leak monitoring (dev önerilir) */
|
|
1393
|
+
useReactiveMonitor(opts?: {
|
|
1394
|
+
enabled?: boolean;
|
|
1395
|
+
threshold?: number;
|
|
1396
|
+
name?: string;
|
|
1397
|
+
}): this;
|
|
1398
|
+
useDevelopment(isDev?: boolean): this;
|
|
1399
|
+
useLogging(enabled?: boolean): this;
|
|
1400
|
+
}
|
|
1401
|
+
declare function useNavigation(): Router;
|
|
1402
|
+
declare function useApplication(): {
|
|
1403
|
+
application: Application;
|
|
1404
|
+
services: ServiceProvider;
|
|
1405
|
+
router: Router;
|
|
1406
|
+
attach(...components: ComponentBase[]): void;
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
declare function Injectable(options?: {
|
|
1410
|
+
lifetime?: ServiceLifetime;
|
|
1411
|
+
deps?: any[];
|
|
1412
|
+
}): (target: any, context?: ClassDecoratorContext) => void;
|
|
1413
|
+
declare function FromService<T = any>(token: any): T;
|
|
1414
|
+
|
|
1415
|
+
type AsyncOrSync<T> = Promise<T> | T;
|
|
1416
|
+
interface Context {
|
|
1417
|
+
[key: string]: any;
|
|
1418
|
+
}
|
|
1419
|
+
type Action<T> = (ctx?: Context) => AsyncOrSync<T>;
|
|
1420
|
+
type ShouldHandlePredicate = (err: any) => boolean;
|
|
1421
|
+
declare abstract class Policy {
|
|
1422
|
+
abstract execute<T>(action: Action<T>, ctx?: Context): Promise<T>;
|
|
1423
|
+
}
|
|
1424
|
+
interface RetryOptions {
|
|
1425
|
+
retries?: number;
|
|
1426
|
+
backoff?: 'fixed' | 'exponential' | 'none';
|
|
1427
|
+
delay?: number;
|
|
1428
|
+
jitter?: number;
|
|
1429
|
+
shouldHandle?: ShouldHandlePredicate;
|
|
1430
|
+
onRetry?: (attempt: number, err: any, delayMs: number, ctx?: Context) => void | Promise<void>;
|
|
1431
|
+
}
|
|
1432
|
+
interface TimeoutOptions {
|
|
1433
|
+
timeoutMs: number;
|
|
1434
|
+
}
|
|
1435
|
+
type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
|
|
1436
|
+
interface CircuitBreakerOptions {
|
|
1437
|
+
failureThreshold?: number;
|
|
1438
|
+
successThreshold?: number;
|
|
1439
|
+
durationOfBreakMs?: number;
|
|
1440
|
+
shouldHandle?: ShouldHandlePredicate;
|
|
1441
|
+
onStateChange?: (oldState: CircuitState, newState: CircuitState) => void | Promise<void>;
|
|
1442
|
+
}
|
|
1443
|
+
interface BulkheadOptions {
|
|
1444
|
+
maxConcurrent?: number;
|
|
1445
|
+
maxQueue?: number;
|
|
1446
|
+
}
|
|
1447
|
+
interface RateLimiterOptions {
|
|
1448
|
+
tokensPerInterval?: number;
|
|
1449
|
+
intervalMs?: number;
|
|
1450
|
+
capacity?: number;
|
|
1451
|
+
}
|
|
1452
|
+
interface FallbackOptions<T> {
|
|
1453
|
+
fallback: (err: any, ctx?: Context) => AsyncOrSync<T>;
|
|
1454
|
+
shouldHandle?: ShouldHandlePredicate;
|
|
1455
|
+
}
|
|
1456
|
+
declare function decorate<T>(policy: Policy, fn: Action<T>): (ctx?: Context) => Promise<T>;
|
|
1457
|
+
declare class Resilience {
|
|
1458
|
+
static get create(): Resilience;
|
|
1459
|
+
private resiliences;
|
|
1460
|
+
retry: (opts?: RetryOptions) => Resilience;
|
|
1461
|
+
timeout: (opts: TimeoutOptions) => Resilience;
|
|
1462
|
+
circuitBreaker: (opts?: CircuitBreakerOptions) => Resilience;
|
|
1463
|
+
bulkhead: (opts?: BulkheadOptions) => Resilience;
|
|
1464
|
+
rateLimiter: (opts?: RateLimiterOptions) => Resilience;
|
|
1465
|
+
fallback: <T>(opts: FallbackOptions<T>) => Resilience;
|
|
1466
|
+
execute<T>(action: Action<T>, ctx?: Context): Promise<T>;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export { Application, ApplicationBuilder, Component, ComponentBase, ComponentMotif, Computed, ContentBlock, ContentBody, ControlCollection, Dictionary, Disposable, DisposableStore, Emitter, ErrorHandler, FNComponent, FragmentNode, Frame, FromService, Injectable, Lazy, LazyComputed, LinkedList, List, MotifError, NameValuePair, NodeTypes, Query, Resilience, RouterLink, RouterView, ServiceCollection, ServiceProvider, Signal, Transport, TransportTo, Transporter, Virtualization, asyncTracking, clearModel, configureReactivityLeakMonitor, createComputed, createLazyComputed, createSignal, decorate, deepClone, disposableCore, dom, effect, errorHandler, inject, motifCompiled, motifComponent, motifFragment, preProcessing, reactive, read, safeCall, safeCallAsync, safeCallSilent, setUnexpectedErrorHandler, toDisposable, toGetter, untracked, useApplication, useModel, useNavigation };
|
|
1470
|
+
export type { AnyEvents, AppLifecycleEventArgs, AppLifecycleState, AsyncTrackingToken, Bind, CSSTransitionInfo, ComponentBaseOptions, CustomParameters, EffectFn, ElementType, Event$1 as Event, EventArgs, Group, HtmlElementEvents, IAttribute, IBaseProp, IClass, IDisposable, IDisposableTracker, IDisposeOptions, IElement, IHtmlElement, IsOptional, LazyOptions, LazyRetryOptions, MotifErrorCode, NavigationDirection, NavigationGuard, NavigationGuardContext, NavigationOptions, OptionalParams, ReadonlySignal, RedirectTarget, ResolveResult, RouteControl, RouteInfo, RouteItem, RouteItemBase, RouteRedirect, RouteResolveContext, Router, RouterClassingSettings, RouterEvents, RouterNavigatedEventArgs, RouterOptions, RouterValidateEventArgs, RouterViewProps, ScrollMemoryOptions, ServiceDescriptor, ServiceLifetime, StackEntryInfo, StackOptions, StackSwipeBackOptions, StackTransitionContext, TransitionProps, TransportOptions, VirtualizationDataRequest, VirtualizationDataResponse, VirtualizationProps, VirtualizationState };
|