dotvvm-types 4.3.0-preview01-final → 4.3.0-preview03-final
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/package.json +1 -1
- package/types/index.d.ts +1250 -1232
package/types/index.d.ts
CHANGED
|
@@ -1,1232 +1,1250 @@
|
|
|
1
|
-
/// <reference types="knockout" />
|
|
2
|
-
declare module "shared-classes" {
|
|
3
|
-
export class DotvvmPostbackError {
|
|
4
|
-
reason: DotvvmPostbackErrorReason;
|
|
5
|
-
constructor(reason: DotvvmPostbackErrorReason);
|
|
6
|
-
toString(): string;
|
|
7
|
-
}
|
|
8
|
-
export class CoerceError implements CoerceErrorType {
|
|
9
|
-
message: string;
|
|
10
|
-
path: string;
|
|
11
|
-
isError: true;
|
|
12
|
-
wasCoerced: false;
|
|
13
|
-
get value(): never;
|
|
14
|
-
constructor(message: string, path?: string);
|
|
15
|
-
static generic(value: any, type: TypeDefinition): CoerceError;
|
|
16
|
-
prependPathFragment(fragment: string): void;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
declare module "utils/logging" {
|
|
20
|
-
type LogLevel = "normal" | "verbose";
|
|
21
|
-
export const level: LogLevel;
|
|
22
|
-
export type DotvvmLoggingArea = ("debug" | "configuration" | "postback" | "spa" | "static-command" | "binding-handler" | "resource-loader" | "coercer" | "state-manager" | "validation" | "events" | "rest-api");
|
|
23
|
-
export function logInfoVerbose(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
24
|
-
export function logInfo(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
25
|
-
export function logWarning(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
26
|
-
export function logError(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
27
|
-
export function logPostBackScriptError(err: any): void;
|
|
28
|
-
/** puts the string in quotes, escaping weird characters if it is more complex than just letters */
|
|
29
|
-
export function debugQuoteString(s: string): string;
|
|
30
|
-
}
|
|
31
|
-
declare module "serialization/date" {
|
|
32
|
-
export function parseDate(value: string | null | undefined, convertFromUtc?: boolean): Date | null;
|
|
33
|
-
export function parseDateOnly(value: string | null | undefined): Date | null;
|
|
34
|
-
export function parseTimeOnly(value: string | null | undefined): Date | null;
|
|
35
|
-
export function parseTimeSpan(value: string | null | undefined): number | null;
|
|
36
|
-
export function parseDateTimeOffset(value: string | null | undefined): Date | null;
|
|
37
|
-
export function serializeDate(date: string | Date | null, convertToUtc?: boolean): string | null;
|
|
38
|
-
export function serializeDateOnly(date: Date): string;
|
|
39
|
-
export function serializeTimeOnly(date: Date): string;
|
|
40
|
-
export function serializeTimeSpan(ticks: number): string;
|
|
41
|
-
}
|
|
42
|
-
declare module "utils/dom" {
|
|
43
|
-
export const getElementByDotvvmId: (id: string) => HTMLElement;
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use addEventListener directly
|
|
46
|
-
*/
|
|
47
|
-
export function attachEvent(target: any, name: string, callback: (ev: PointerEvent) => any, useCapture?: boolean): void;
|
|
48
|
-
export const isElementDisabled: (element: HTMLElement | null | undefined) => boolean | null | undefined;
|
|
49
|
-
export function setIdFragment(idFragment: string | null | undefined): void;
|
|
50
|
-
}
|
|
51
|
-
declare module "utils/knockout" {
|
|
52
|
-
export function wrapObservable<T>(obj: T): KnockoutObservable<T>;
|
|
53
|
-
export function wrapObservableObjectOrArray<T>(obj: T): KnockoutObservable<T> | KnockoutObservableArray<T>;
|
|
54
|
-
export function isObservableArray(target: any): boolean;
|
|
55
|
-
/** If ko.options.deferUpdates is on,
|
|
56
|
-
* obs.notifySubscribers() will not invoke them if the value didn't change, because the equalityComparer is checked again when the notification runs.
|
|
57
|
-
* This function removes the equalityComparer, waits for all tasks and returns it */
|
|
58
|
-
export function hackInvokeNotifySubscribers(obs: KnockoutObservable<any>): void;
|
|
59
|
-
}
|
|
60
|
-
declare module "utils/objects" {
|
|
61
|
-
export function isPrimitive(viewModel: any): boolean;
|
|
62
|
-
export const createArray: {
|
|
63
|
-
<T>(arrayLike: ArrayLike<T>): T[];
|
|
64
|
-
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
65
|
-
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
66
|
-
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
67
|
-
};
|
|
68
|
-
export const hasOwnProperty: (obj: any, prop: string) => boolean;
|
|
69
|
-
export const keys: {
|
|
70
|
-
(o: object): string[];
|
|
71
|
-
(o: {}): string[];
|
|
72
|
-
};
|
|
73
|
-
export function defineConstantProperty(obj: any, name: string, value: any): void;
|
|
74
|
-
}
|
|
75
|
-
declare module "metadata/typeMap" {
|
|
76
|
-
export function getTypeInfo(typeId: string | object): TypeMetadata;
|
|
77
|
-
export function getObjectTypeInfo(typeId: string): ObjectTypeMetadata | DynamicTypeMetadata;
|
|
78
|
-
export function getTypeProperties(typeId: string | object | null | undefined): {
|
|
79
|
-
[prop: string]: PropertyMetadata;
|
|
80
|
-
};
|
|
81
|
-
export function getKnownTypes(): string[];
|
|
82
|
-
export function updateTypeInfo(newTypes: TypeMap | undefined): void;
|
|
83
|
-
export function replaceTypeInfo(newTypes: TypeMap | undefined): void;
|
|
84
|
-
export function areObjectTypesEqual(currentValue: any, newVal: any): boolean;
|
|
85
|
-
export function formatTypeName(type: TypeDefinition, prefix?: string, suffix?: string): string;
|
|
86
|
-
}
|
|
87
|
-
declare module "events" {
|
|
88
|
-
export class DotvvmEvent<T> {
|
|
89
|
-
readonly name: string;
|
|
90
|
-
private readonly triggerMissedEventsOnSubscribe;
|
|
91
|
-
private handlers;
|
|
92
|
-
private history;
|
|
93
|
-
constructor(name: string, triggerMissedEventsOnSubscribe?: boolean);
|
|
94
|
-
subscribe(handler: (data: T) => void): void;
|
|
95
|
-
subscribeOnce(handler: (data: T) => void): void;
|
|
96
|
-
unsubscribe(handler: (data: T) => void): void;
|
|
97
|
-
trigger(data: T): void;
|
|
98
|
-
}
|
|
99
|
-
export const init: DotvvmEvent<DotvvmInitEventArgs>;
|
|
100
|
-
export const initCompleted: DotvvmEvent<DotvvmInitCompletedEventArgs>;
|
|
101
|
-
export const beforePostback: DotvvmEvent<DotvvmBeforePostBackEventArgs>;
|
|
102
|
-
export const afterPostback: DotvvmEvent<DotvvmAfterPostBackEventArgs>;
|
|
103
|
-
export const error: DotvvmEvent<DotvvmErrorEventArgs>;
|
|
104
|
-
export const redirect: DotvvmEvent<DotvvmRedirectEventArgs>;
|
|
105
|
-
export const postbackHandlersStarted: DotvvmEvent<PostbackOptions>;
|
|
106
|
-
export const postbackHandlersCompleted: DotvvmEvent<PostbackOptions>;
|
|
107
|
-
export const postbackResponseReceived: DotvvmEvent<DotvvmPostbackResponseReceivedEventArgs>;
|
|
108
|
-
export const postbackCommitInvoked: DotvvmEvent<DotvvmPostbackCommitInvokedEventArgs>;
|
|
109
|
-
export const postbackViewModelUpdated: DotvvmEvent<DotvvmPostbackViewModelUpdatedEventArgs>;
|
|
110
|
-
export const postbackRejected: DotvvmEvent<DotvvmPostbackRejectedEventArgs>;
|
|
111
|
-
export const staticCommandMethodInvoking: DotvvmEvent<DotvvmStaticCommandMethodInvokingEventArgs>;
|
|
112
|
-
export const staticCommandMethodInvoked: DotvvmEvent<DotvvmStaticCommandMethodInvokedEventArgs>;
|
|
113
|
-
export const staticCommandMethodFailed: DotvvmEvent<DotvvmStaticCommandMethodFailedEventArgs>;
|
|
114
|
-
export const newState: DotvvmEvent<RootViewModel>;
|
|
115
|
-
}
|
|
116
|
-
declare module "utils/isNumber" {
|
|
117
|
-
export function isNumber(value: any): boolean;
|
|
118
|
-
}
|
|
119
|
-
declare module "metadata/enums" {
|
|
120
|
-
export function enumStringToInt(value: number | string, type: EnumTypeMetadata): number | null;
|
|
121
|
-
export function enumIntToString(value: number, type: EnumTypeMetadata): string | null;
|
|
122
|
-
export function tryCoerceEnum(value: any, type: EnumTypeMetadata): CoerceResult;
|
|
123
|
-
}
|
|
124
|
-
declare module "metadata/primitiveTypes" {
|
|
125
|
-
type PrimitiveTypes = {
|
|
126
|
-
[name: string]: {
|
|
127
|
-
tryCoerce: (value: any) => CoerceResult | undefined;
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
export const primitiveTypes: PrimitiveTypes;
|
|
131
|
-
}
|
|
132
|
-
declare module "metadata/coercer" {
|
|
133
|
-
/**
|
|
134
|
-
* Validates type of value
|
|
135
|
-
* @param type Expected type of type value.
|
|
136
|
-
* @param originalValue Value that is known to be valid instance of type. It is used to perform incremental validation.
|
|
137
|
-
*/
|
|
138
|
-
export function tryCoerce(value: any, type: TypeDefinition | null | undefined, originalValue?: any): CoerceResult;
|
|
139
|
-
export function coerce(value: any, type: TypeDefinition, originalValue?: any): any;
|
|
140
|
-
}
|
|
141
|
-
declare module "utils/promise" {
|
|
142
|
-
/** Runs the callback in the next event loop cycle */
|
|
143
|
-
export const defer: <T>(callback: () => T) => Promise<T>;
|
|
144
|
-
}
|
|
145
|
-
declare module "postback/updater" {
|
|
146
|
-
export function cleanUpdatedControls(resultObject: any, updatedControls?: any): any;
|
|
147
|
-
export function restoreUpdatedControls(resultObject: any, updatedControls: any): void;
|
|
148
|
-
export function updateViewModelAndControls(resultObject: any, updateTypeInfo: (t: TypeMap) => void): void;
|
|
149
|
-
export function patchViewModel(source: any, patch: any): any;
|
|
150
|
-
export function diffViewModel(source: any, modified: any): any;
|
|
151
|
-
}
|
|
152
|
-
declare module "validation/common" {
|
|
153
|
-
export type DotvvmValidationContext = {
|
|
154
|
-
readonly valueToValidate: any;
|
|
155
|
-
readonly parentViewModel: any;
|
|
156
|
-
readonly parameters: any[];
|
|
157
|
-
};
|
|
158
|
-
export type DotvvmValidationObservableMetadata = DotvvmValidationElementMetadata[];
|
|
159
|
-
export type DotvvmValidationElementMetadata = {
|
|
160
|
-
element: HTMLElement;
|
|
161
|
-
dataType: string;
|
|
162
|
-
format: string;
|
|
163
|
-
domNodeDisposal: boolean;
|
|
164
|
-
elementValidationState: boolean;
|
|
165
|
-
};
|
|
166
|
-
export const errorsSymbol: unique symbol;
|
|
167
|
-
/** Checks if the value is null, undefined or a whitespace only string */
|
|
168
|
-
export function isEmpty(value: any): boolean;
|
|
169
|
-
export function getValidationMetadata(property: KnockoutObservable<any>): DotvvmValidationObservableMetadata;
|
|
170
|
-
}
|
|
171
|
-
declare module "utils/evaluator" {
|
|
172
|
-
/**
|
|
173
|
-
* Traverses provided context according to given path.
|
|
174
|
-
* @example / - returns context
|
|
175
|
-
* @example "" or null - returns context
|
|
176
|
-
* @example /exampleProp/A - returns prop A located withing property exampleProp located at provided context
|
|
177
|
-
* @example /exampleProp/B/1 - returns second item from collection B located within property exampleProp located at provided context
|
|
178
|
-
* @returns found property as unwrapped object
|
|
179
|
-
*/
|
|
180
|
-
export function traverseContext(context: any, path: string): any;
|
|
181
|
-
export function findPathToChildObservable(vm: any, child: any, path: string): string | null;
|
|
182
|
-
export function getDataSourceItems(viewModel: any): Array<KnockoutObservable<any>>;
|
|
183
|
-
export function wrapObservable(func: () => any, isArray?: boolean): KnockoutComputed<any>;
|
|
184
|
-
export const unwrapComputedProperty: (obs: any) => any;
|
|
185
|
-
}
|
|
186
|
-
declare module "validation/error" {
|
|
187
|
-
export const allErrors: ValidationError[];
|
|
188
|
-
export function detachAllErrors(): void;
|
|
189
|
-
export function getErrors<T>(o: KnockoutObservable<T> | null): ValidationError[];
|
|
190
|
-
export class ValidationError {
|
|
191
|
-
errorMessage: string;
|
|
192
|
-
propertyPath: string;
|
|
193
|
-
validatedObservable: KnockoutObservable<any>;
|
|
194
|
-
private constructor();
|
|
195
|
-
static attach(errorMessage: string, propertyPath: string, observable: KnockoutObservable<any>): ValidationError;
|
|
196
|
-
detach(): void;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
declare module "state-manager" {
|
|
200
|
-
import { DotvvmEvent } from "events";
|
|
201
|
-
export const currentStateSymbol: unique symbol;
|
|
202
|
-
export const notifySymbol: unique symbol;
|
|
203
|
-
export const lastSetErrorSymbol: unique symbol;
|
|
204
|
-
export const internalPropCache: unique symbol;
|
|
205
|
-
export const updateSymbol: unique symbol;
|
|
206
|
-
export const updatePropertySymbol: unique symbol;
|
|
207
|
-
export function getIsViewModelUpdating(): boolean;
|
|
208
|
-
export type UpdatableObjectExtensions<T> = {
|
|
209
|
-
[notifySymbol]: (newValue: T) => void;
|
|
210
|
-
[currentStateSymbol]: T;
|
|
211
|
-
[updateSymbol]?: UpdateDispatcher<T>;
|
|
212
|
-
};
|
|
213
|
-
export class StateManager<TViewModel extends {
|
|
214
|
-
$type?: TypeDefinition;
|
|
215
|
-
}> {
|
|
216
|
-
stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>;
|
|
217
|
-
readonly stateObservable: DeepKnockoutObservable<TViewModel>;
|
|
218
|
-
private _state;
|
|
219
|
-
get state(): DeepReadonly<TViewModel>;
|
|
220
|
-
private _isDirty;
|
|
221
|
-
get isDirty(): boolean;
|
|
222
|
-
private _currentFrameNumber;
|
|
223
|
-
constructor(initialState: DeepReadonly<TViewModel>, stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>);
|
|
224
|
-
dispatchUpdate(): void;
|
|
225
|
-
doUpdateNow(): void;
|
|
226
|
-
private rerender;
|
|
227
|
-
setState(newState: DeepReadonly<TViewModel>): DeepReadonly<TViewModel>;
|
|
228
|
-
patchState(patch: Partial<TViewModel>): DeepReadonly<TViewModel>;
|
|
229
|
-
update(updater: StateUpdate<TViewModel>): DeepReadonly<TViewModel>;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Recursively unwraps knockout observables from the object / array hierarchy. When nothing needs to be unwrapped, the original object is returned.
|
|
233
|
-
* @param allowStateUnwrap Allows accessing [currentStateSymbol], which makes it faster, but doesn't register in the knockout dependency tracker
|
|
234
|
-
*/
|
|
235
|
-
export function unmapKnockoutObservables(viewModel: any, allowStateUnwrap?: boolean): any;
|
|
236
|
-
}
|
|
237
|
-
declare module "serialization/deserialize" {
|
|
238
|
-
export function deserialize(viewModel: any, target?: any, deserializeAll?: boolean): any;
|
|
239
|
-
export function deserializePrimitive(viewModel: any, target?: any): any;
|
|
240
|
-
export function deserializeDate(viewModel: any, target?: any): any;
|
|
241
|
-
export function deserializeArray(viewModel: any, target?: any, deserializeAll?: boolean): any;
|
|
242
|
-
export function deserializeObject(viewModel: any, target: any, deserializeAll: boolean): any;
|
|
243
|
-
export function extendToObservableArrayIfRequired(observable: any): any;
|
|
244
|
-
/** Clones only updatable properties from the object.
|
|
245
|
-
* Used after postback, to avoid updating properties which were sent to server, but weren't sent back. */
|
|
246
|
-
export function mapUpdatableProperties(viewModel: any, type?: TypeDefinition | undefined): any;
|
|
247
|
-
}
|
|
248
|
-
declare module "serialization/serialize" {
|
|
249
|
-
interface ISerializationOptions {
|
|
250
|
-
serializeAll?: boolean;
|
|
251
|
-
ignoreSpecialProperties?: boolean;
|
|
252
|
-
pathMatcher?: (vm: any) => boolean;
|
|
253
|
-
path?: string[];
|
|
254
|
-
pathOnly?: boolean;
|
|
255
|
-
restApiTarget?: boolean;
|
|
256
|
-
}
|
|
257
|
-
export function serialize(viewModel: any, opt?: ISerializationOptions): any;
|
|
258
|
-
export function serializeCore(viewModel: any, opt?: ISerializationOptions): any;
|
|
259
|
-
}
|
|
260
|
-
declare module "postback/resourceLoader" {
|
|
261
|
-
export type RenderedResourceList = {
|
|
262
|
-
[name: string]: string;
|
|
263
|
-
};
|
|
264
|
-
export function registerResources(rs: string[] | null | undefined): void;
|
|
265
|
-
export const getRenderedResources: () => string[];
|
|
266
|
-
export function loadResourceList(resources: RenderedResourceList | undefined): Promise<void>;
|
|
267
|
-
export function notifyModuleLoaded(id: number): void;
|
|
268
|
-
}
|
|
269
|
-
declare module "binding-handlers/textbox-text" {
|
|
270
|
-
const _default: {
|
|
271
|
-
"dotvvm-textbox-text": {
|
|
272
|
-
init(element: HTMLInputElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): void;
|
|
273
|
-
update(element: HTMLInputElement, valueAccessor: () => any): void;
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
export default _default;
|
|
277
|
-
}
|
|
278
|
-
declare module "binding-handlers/textbox-select-all-on-focus" {
|
|
279
|
-
const _default_1: {
|
|
280
|
-
"dotvvm-textbox-select-all-on-focus": {
|
|
281
|
-
init(element: any): void;
|
|
282
|
-
update(element: any, valueAccessor: () => any): void;
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
export default _default_1;
|
|
286
|
-
}
|
|
287
|
-
declare module "binding-handlers/SSR-foreach" {
|
|
288
|
-
type SeenUpdateElement = HTMLElement & {
|
|
289
|
-
seenUpdate?: number;
|
|
290
|
-
};
|
|
291
|
-
const _default_2: {
|
|
292
|
-
"dotvvm-SSR-foreach": {
|
|
293
|
-
init(element: Node, valueAccessor: () => any, allBindings?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext): {
|
|
294
|
-
controlsDescendantBindings: boolean;
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
"dotvvm-SSR-item": {
|
|
298
|
-
init<T>(element: SeenUpdateElement, valueAccessor: () => T, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext): {
|
|
299
|
-
controlsDescendantBindings: boolean;
|
|
300
|
-
};
|
|
301
|
-
update(element: SeenUpdateElement): void;
|
|
302
|
-
};
|
|
303
|
-
};
|
|
304
|
-
export default _default_2;
|
|
305
|
-
}
|
|
306
|
-
declare module "viewModules/viewModuleManager" {
|
|
307
|
-
type ModuleCommand = (...args: any) => Promise<unknown>;
|
|
308
|
-
export const viewModulesSymbol: unique symbol;
|
|
309
|
-
export function registerViewModule(name: string, moduleObject: any): void;
|
|
310
|
-
export function registerViewModules(modules: {
|
|
311
|
-
[name: string]: any;
|
|
312
|
-
}): void;
|
|
313
|
-
export function initViewModule(name: string, viewIdOrElement: string | HTMLElement, rootElement: HTMLElement, properties?: object): ModuleContext;
|
|
314
|
-
export function callViewModuleCommand(viewIdOrElement: string | HTMLElement, commandName: string, args: any[], allowAsync?: boolean): any;
|
|
315
|
-
export function findComponent(viewIdOrElement: null | string | HTMLElement, name: string): [ModuleContext | null, DotvvmJsComponentFactory];
|
|
316
|
-
export function registerGlobalComponent(name: string, c: DotvvmJsComponentFactory): void;
|
|
317
|
-
export function registerNamedCommand(viewIdOrElement: string | HTMLElement, commandName: string, command: ModuleCommand, rootElement: HTMLElement): void;
|
|
318
|
-
export function unregisterNamedCommand(viewIdOrElement: string | HTMLElement, commandName: string): void;
|
|
319
|
-
export class ModuleContext implements DotvvmModuleContext {
|
|
320
|
-
readonly moduleName: string;
|
|
321
|
-
readonly elements: HTMLElement[];
|
|
322
|
-
readonly properties: {
|
|
323
|
-
[name: string]: any;
|
|
324
|
-
};
|
|
325
|
-
readonly namedCommands: {
|
|
326
|
-
[name: string]: (...args: any[]) => Promise<any>;
|
|
327
|
-
};
|
|
328
|
-
module: any;
|
|
329
|
-
setState: (state: any) => void;
|
|
330
|
-
patchState: (state: any) => void;
|
|
331
|
-
updateState: (updateFunction: StateUpdate<any>) => void;
|
|
332
|
-
state: any;
|
|
333
|
-
constructor(moduleName: string, elements: HTMLElement[], properties: {
|
|
334
|
-
[name: string]: any;
|
|
335
|
-
}, viewModel: DotvvmObservable<any>);
|
|
336
|
-
registerNamedCommand: (name: string, command: (...args: any[]) => Promise<any>) => void;
|
|
337
|
-
unregisterNamedCommand: (name: string) => void;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
declare module "binding-handlers/markup-controls" {
|
|
341
|
-
export function wrapControlProperties(valueAccessor: () => any): any;
|
|
342
|
-
const _default_3: {
|
|
343
|
-
'dotvvm-with-control-properties': {
|
|
344
|
-
init: (element: HTMLElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
|
|
345
|
-
controlsDescendantBindings: boolean;
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
'dotvvm-with-view-modules': {
|
|
349
|
-
init: (element: HTMLElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
|
|
350
|
-
controlsDescendantBindings: boolean;
|
|
351
|
-
} | undefined;
|
|
352
|
-
};
|
|
353
|
-
};
|
|
354
|
-
export default _default_3;
|
|
355
|
-
}
|
|
356
|
-
declare module "binding-handlers/table-columnvisible" {
|
|
357
|
-
const _default_4: {
|
|
358
|
-
'dotvvm-table-columnvisible': {
|
|
359
|
-
init(element: HTMLElement, valueAccessor: () => any): void;
|
|
360
|
-
update(element: any, valueAccessor: any): void;
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
export default _default_4;
|
|
364
|
-
}
|
|
365
|
-
declare module "binding-handlers/enable" {
|
|
366
|
-
const _default_5: {
|
|
367
|
-
'dotvvm-enable': {
|
|
368
|
-
update: (element: HTMLInputElement, valueAccessor: () => KnockoutObservable<boolean>) => void;
|
|
369
|
-
};
|
|
370
|
-
};
|
|
371
|
-
export default _default_5;
|
|
372
|
-
}
|
|
373
|
-
declare module "binding-handlers/checkbox" {
|
|
374
|
-
const _default_6: {
|
|
375
|
-
'dotvvm-checkbox-updateAfterPostback': {
|
|
376
|
-
init(element: HTMLElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): void;
|
|
377
|
-
};
|
|
378
|
-
'dotvvm-checked-pointer': {};
|
|
379
|
-
"dotvvm-CheckState": {
|
|
380
|
-
init: ((element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | {
|
|
381
|
-
controlsDescendantBindings: boolean;
|
|
382
|
-
}) | undefined;
|
|
383
|
-
update(element: any, valueAccessor: () => any): void;
|
|
384
|
-
};
|
|
385
|
-
"dotvvm-checkedItems": {
|
|
386
|
-
after: string[] | undefined;
|
|
387
|
-
init: ((element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | {
|
|
388
|
-
controlsDescendantBindings: boolean;
|
|
389
|
-
}) | undefined;
|
|
390
|
-
options: any;
|
|
391
|
-
update(element: any, valueAccessor: () => any): void;
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
|
-
export default _default_6;
|
|
395
|
-
}
|
|
396
|
-
declare module "postback/queue" {
|
|
397
|
-
export const updateProgressChangeCounter: KnockoutObservable<number>;
|
|
398
|
-
export const postbackQueues: {
|
|
399
|
-
[name: string]: {
|
|
400
|
-
queue: Array<(() => void)>;
|
|
401
|
-
noRunning: number;
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
export function getPostbackQueue(name?: string): {
|
|
405
|
-
queue: (() => void)[];
|
|
406
|
-
noRunning: number;
|
|
407
|
-
};
|
|
408
|
-
export function enterActivePostback(queueName: string): void;
|
|
409
|
-
export function leaveActivePostback(queueName: string): void;
|
|
410
|
-
export function runNextInQueue(queueName: string): void;
|
|
411
|
-
}
|
|
412
|
-
declare module "binding-handlers/update-progress" {
|
|
413
|
-
const _default_7: {
|
|
414
|
-
"dotvvm-UpdateProgress-Visible": {
|
|
415
|
-
init(element: HTMLElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext): void;
|
|
416
|
-
};
|
|
417
|
-
};
|
|
418
|
-
export default _default_7;
|
|
419
|
-
}
|
|
420
|
-
declare module "binding-handlers/gridviewdataset" {
|
|
421
|
-
const _default_8: {
|
|
422
|
-
"dotvvm-gridviewdataset": {
|
|
423
|
-
init: (element: Node, valueAccessor: () => any, allBindings: KnockoutAllBindingsAccessor | undefined, _viewModel: any, bindingContext: KnockoutBindingContext | undefined) => {
|
|
424
|
-
controlsDescendantBindings: boolean;
|
|
425
|
-
};
|
|
426
|
-
};
|
|
427
|
-
};
|
|
428
|
-
export default _default_8;
|
|
429
|
-
}
|
|
430
|
-
declare module "binding-handlers/named-command" {
|
|
431
|
-
const _default_9: {
|
|
432
|
-
'dotvvm-named-command': {
|
|
433
|
-
init: (element: HTMLElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
|
|
434
|
-
controlsDescendantBindings: boolean;
|
|
435
|
-
};
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
export default _default_9;
|
|
439
|
-
}
|
|
440
|
-
declare module "binding-handlers/file-upload" {
|
|
441
|
-
const _default_10: {
|
|
442
|
-
"dotvvm-FileUpload": {
|
|
443
|
-
init: (element: HTMLInputElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => void;
|
|
444
|
-
};
|
|
445
|
-
};
|
|
446
|
-
export default _default_10;
|
|
447
|
-
}
|
|
448
|
-
declare module "binding-handlers/js-component" {
|
|
449
|
-
const _default_11: {
|
|
450
|
-
"dotvvm-js-component": {
|
|
451
|
-
init(element: HTMLInputElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): {
|
|
452
|
-
controlsDescendantBindings: boolean;
|
|
453
|
-
};
|
|
454
|
-
};
|
|
455
|
-
};
|
|
456
|
-
export default _default_11;
|
|
457
|
-
}
|
|
458
|
-
declare module "binding-handlers/
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
export
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
export
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
export
|
|
480
|
-
export
|
|
481
|
-
export
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
export
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
export function
|
|
491
|
-
|
|
492
|
-
export function
|
|
493
|
-
export function
|
|
494
|
-
export function
|
|
495
|
-
export
|
|
496
|
-
export function
|
|
497
|
-
export function
|
|
498
|
-
export function
|
|
499
|
-
export function
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
export function
|
|
509
|
-
export function
|
|
510
|
-
export
|
|
511
|
-
export function
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
export
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
export function
|
|
525
|
-
export function
|
|
526
|
-
export function
|
|
527
|
-
}
|
|
528
|
-
declare module "postback/
|
|
529
|
-
export
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
export function
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
export function
|
|
540
|
-
export function
|
|
541
|
-
export function
|
|
542
|
-
}
|
|
543
|
-
declare module "
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
export
|
|
551
|
-
export
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
export
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
export const
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
export const
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
export const
|
|
579
|
-
name: string;
|
|
580
|
-
before: string[];
|
|
581
|
-
execute(next: () => Promise<PostbackCommitFunction>, options: PostbackOptions)
|
|
582
|
-
};
|
|
583
|
-
export
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
export
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
export
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* The
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
export function
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
export
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
export function
|
|
665
|
-
export function
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
export function
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
export function
|
|
678
|
-
|
|
679
|
-
export function
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
export
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
export
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
export function
|
|
698
|
-
}
|
|
699
|
-
declare module "
|
|
700
|
-
export
|
|
701
|
-
export function
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
export function
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
export
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
export
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
export
|
|
720
|
-
function
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
function
|
|
724
|
-
function
|
|
725
|
-
function
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
function
|
|
736
|
-
function
|
|
737
|
-
function
|
|
738
|
-
function
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
export function
|
|
761
|
-
export function
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
export function
|
|
765
|
-
}
|
|
766
|
-
declare module "translations/
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
import
|
|
785
|
-
import * as
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
import
|
|
800
|
-
import * as
|
|
801
|
-
import * as
|
|
802
|
-
import
|
|
803
|
-
import {
|
|
804
|
-
import {
|
|
805
|
-
import
|
|
806
|
-
import
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
} | {
|
|
947
|
-
type: '
|
|
948
|
-
} | {
|
|
949
|
-
type: '
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
readonly
|
|
978
|
-
readonly
|
|
979
|
-
readonly
|
|
980
|
-
readonly
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
readonly
|
|
997
|
-
|
|
998
|
-
readonly
|
|
999
|
-
};
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
readonly
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
readonly response
|
|
1022
|
-
};
|
|
1023
|
-
|
|
1024
|
-
readonly
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
/**
|
|
1111
|
-
|
|
1112
|
-
/**
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
};
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
};
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
};
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
[name: string]:
|
|
1231
|
-
};
|
|
1232
|
-
|
|
1
|
+
/// <reference types="knockout" />
|
|
2
|
+
declare module "shared-classes" {
|
|
3
|
+
export class DotvvmPostbackError {
|
|
4
|
+
reason: DotvvmPostbackErrorReason;
|
|
5
|
+
constructor(reason: DotvvmPostbackErrorReason);
|
|
6
|
+
toString(): string;
|
|
7
|
+
}
|
|
8
|
+
export class CoerceError implements CoerceErrorType {
|
|
9
|
+
message: string;
|
|
10
|
+
path: string;
|
|
11
|
+
isError: true;
|
|
12
|
+
wasCoerced: false;
|
|
13
|
+
get value(): never;
|
|
14
|
+
constructor(message: string, path?: string);
|
|
15
|
+
static generic(value: any, type: TypeDefinition): CoerceError;
|
|
16
|
+
prependPathFragment(fragment: string): void;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
declare module "utils/logging" {
|
|
20
|
+
type LogLevel = "normal" | "verbose";
|
|
21
|
+
export const level: LogLevel;
|
|
22
|
+
export type DotvvmLoggingArea = ("debug" | "configuration" | "postback" | "spa" | "static-command" | "binding-handler" | "resource-loader" | "coercer" | "state-manager" | "validation" | "events" | "rest-api");
|
|
23
|
+
export function logInfoVerbose(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
24
|
+
export function logInfo(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
25
|
+
export function logWarning(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
26
|
+
export function logError(area: DotvvmLoggingArea, ...args: any[]): void;
|
|
27
|
+
export function logPostBackScriptError(err: any): void;
|
|
28
|
+
/** puts the string in quotes, escaping weird characters if it is more complex than just letters */
|
|
29
|
+
export function debugQuoteString(s: string): string;
|
|
30
|
+
}
|
|
31
|
+
declare module "serialization/date" {
|
|
32
|
+
export function parseDate(value: string | null | undefined, convertFromUtc?: boolean): Date | null;
|
|
33
|
+
export function parseDateOnly(value: string | null | undefined): Date | null;
|
|
34
|
+
export function parseTimeOnly(value: string | null | undefined): Date | null;
|
|
35
|
+
export function parseTimeSpan(value: string | null | undefined): number | null;
|
|
36
|
+
export function parseDateTimeOffset(value: string | null | undefined): Date | null;
|
|
37
|
+
export function serializeDate(date: string | Date | null, convertToUtc?: boolean): string | null;
|
|
38
|
+
export function serializeDateOnly(date: Date): string;
|
|
39
|
+
export function serializeTimeOnly(date: Date): string;
|
|
40
|
+
export function serializeTimeSpan(ticks: number): string;
|
|
41
|
+
}
|
|
42
|
+
declare module "utils/dom" {
|
|
43
|
+
export const getElementByDotvvmId: (id: string) => HTMLElement;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use addEventListener directly
|
|
46
|
+
*/
|
|
47
|
+
export function attachEvent(target: any, name: string, callback: (ev: PointerEvent) => any, useCapture?: boolean): void;
|
|
48
|
+
export const isElementDisabled: (element: HTMLElement | null | undefined) => boolean | null | undefined;
|
|
49
|
+
export function setIdFragment(idFragment: string | null | undefined): void;
|
|
50
|
+
}
|
|
51
|
+
declare module "utils/knockout" {
|
|
52
|
+
export function wrapObservable<T>(obj: T): KnockoutObservable<T>;
|
|
53
|
+
export function wrapObservableObjectOrArray<T>(obj: T): KnockoutObservable<T> | KnockoutObservableArray<T>;
|
|
54
|
+
export function isObservableArray(target: any): boolean;
|
|
55
|
+
/** If ko.options.deferUpdates is on,
|
|
56
|
+
* obs.notifySubscribers() will not invoke them if the value didn't change, because the equalityComparer is checked again when the notification runs.
|
|
57
|
+
* This function removes the equalityComparer, waits for all tasks and returns it */
|
|
58
|
+
export function hackInvokeNotifySubscribers(obs: KnockoutObservable<any>): void;
|
|
59
|
+
}
|
|
60
|
+
declare module "utils/objects" {
|
|
61
|
+
export function isPrimitive(viewModel: any): boolean;
|
|
62
|
+
export const createArray: {
|
|
63
|
+
<T>(arrayLike: ArrayLike<T>): T[];
|
|
64
|
+
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
65
|
+
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
66
|
+
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
67
|
+
};
|
|
68
|
+
export const hasOwnProperty: (obj: any, prop: string) => boolean;
|
|
69
|
+
export const keys: {
|
|
70
|
+
(o: object): string[];
|
|
71
|
+
(o: {}): string[];
|
|
72
|
+
};
|
|
73
|
+
export function defineConstantProperty(obj: any, name: string, value: any): void;
|
|
74
|
+
}
|
|
75
|
+
declare module "metadata/typeMap" {
|
|
76
|
+
export function getTypeInfo(typeId: string | object): TypeMetadata;
|
|
77
|
+
export function getObjectTypeInfo(typeId: string): ObjectTypeMetadata | DynamicTypeMetadata;
|
|
78
|
+
export function getTypeProperties(typeId: string | object | null | undefined): {
|
|
79
|
+
[prop: string]: PropertyMetadata;
|
|
80
|
+
};
|
|
81
|
+
export function getKnownTypes(): string[];
|
|
82
|
+
export function updateTypeInfo(newTypes: TypeMap | undefined): void;
|
|
83
|
+
export function replaceTypeInfo(newTypes: TypeMap | undefined): void;
|
|
84
|
+
export function areObjectTypesEqual(currentValue: any, newVal: any): boolean;
|
|
85
|
+
export function formatTypeName(type: TypeDefinition, prefix?: string, suffix?: string): string;
|
|
86
|
+
}
|
|
87
|
+
declare module "events" {
|
|
88
|
+
export class DotvvmEvent<T> {
|
|
89
|
+
readonly name: string;
|
|
90
|
+
private readonly triggerMissedEventsOnSubscribe;
|
|
91
|
+
private handlers;
|
|
92
|
+
private history;
|
|
93
|
+
constructor(name: string, triggerMissedEventsOnSubscribe?: boolean);
|
|
94
|
+
subscribe(handler: (data: T) => void): void;
|
|
95
|
+
subscribeOnce(handler: (data: T) => void): void;
|
|
96
|
+
unsubscribe(handler: (data: T) => void): void;
|
|
97
|
+
trigger(data: T): void;
|
|
98
|
+
}
|
|
99
|
+
export const init: DotvvmEvent<DotvvmInitEventArgs>;
|
|
100
|
+
export const initCompleted: DotvvmEvent<DotvvmInitCompletedEventArgs>;
|
|
101
|
+
export const beforePostback: DotvvmEvent<DotvvmBeforePostBackEventArgs>;
|
|
102
|
+
export const afterPostback: DotvvmEvent<DotvvmAfterPostBackEventArgs>;
|
|
103
|
+
export const error: DotvvmEvent<DotvvmErrorEventArgs>;
|
|
104
|
+
export const redirect: DotvvmEvent<DotvvmRedirectEventArgs>;
|
|
105
|
+
export const postbackHandlersStarted: DotvvmEvent<PostbackOptions>;
|
|
106
|
+
export const postbackHandlersCompleted: DotvvmEvent<PostbackOptions>;
|
|
107
|
+
export const postbackResponseReceived: DotvvmEvent<DotvvmPostbackResponseReceivedEventArgs>;
|
|
108
|
+
export const postbackCommitInvoked: DotvvmEvent<DotvvmPostbackCommitInvokedEventArgs>;
|
|
109
|
+
export const postbackViewModelUpdated: DotvvmEvent<DotvvmPostbackViewModelUpdatedEventArgs>;
|
|
110
|
+
export const postbackRejected: DotvvmEvent<DotvvmPostbackRejectedEventArgs>;
|
|
111
|
+
export const staticCommandMethodInvoking: DotvvmEvent<DotvvmStaticCommandMethodInvokingEventArgs>;
|
|
112
|
+
export const staticCommandMethodInvoked: DotvvmEvent<DotvvmStaticCommandMethodInvokedEventArgs>;
|
|
113
|
+
export const staticCommandMethodFailed: DotvvmEvent<DotvvmStaticCommandMethodFailedEventArgs>;
|
|
114
|
+
export const newState: DotvvmEvent<RootViewModel>;
|
|
115
|
+
}
|
|
116
|
+
declare module "utils/isNumber" {
|
|
117
|
+
export function isNumber(value: any): boolean;
|
|
118
|
+
}
|
|
119
|
+
declare module "metadata/enums" {
|
|
120
|
+
export function enumStringToInt(value: number | string, type: EnumTypeMetadata): number | null;
|
|
121
|
+
export function enumIntToString(value: number, type: EnumTypeMetadata): string | null;
|
|
122
|
+
export function tryCoerceEnum(value: any, type: EnumTypeMetadata): CoerceResult;
|
|
123
|
+
}
|
|
124
|
+
declare module "metadata/primitiveTypes" {
|
|
125
|
+
type PrimitiveTypes = {
|
|
126
|
+
[name: string]: {
|
|
127
|
+
tryCoerce: (value: any) => CoerceResult | undefined;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export const primitiveTypes: PrimitiveTypes;
|
|
131
|
+
}
|
|
132
|
+
declare module "metadata/coercer" {
|
|
133
|
+
/**
|
|
134
|
+
* Validates type of value
|
|
135
|
+
* @param type Expected type of type value.
|
|
136
|
+
* @param originalValue Value that is known to be valid instance of type. It is used to perform incremental validation.
|
|
137
|
+
*/
|
|
138
|
+
export function tryCoerce(value: any, type: TypeDefinition | null | undefined, originalValue?: any): CoerceResult;
|
|
139
|
+
export function coerce(value: any, type: TypeDefinition, originalValue?: any): any;
|
|
140
|
+
}
|
|
141
|
+
declare module "utils/promise" {
|
|
142
|
+
/** Runs the callback in the next event loop cycle */
|
|
143
|
+
export const defer: <T>(callback: () => T) => Promise<T>;
|
|
144
|
+
}
|
|
145
|
+
declare module "postback/updater" {
|
|
146
|
+
export function cleanUpdatedControls(resultObject: any, updatedControls?: any): any;
|
|
147
|
+
export function restoreUpdatedControls(resultObject: any, updatedControls: any): void;
|
|
148
|
+
export function updateViewModelAndControls(resultObject: any, updateTypeInfo: (t: TypeMap) => void): void;
|
|
149
|
+
export function patchViewModel(source: any, patch: any): any;
|
|
150
|
+
export function diffViewModel(source: any, modified: any): any;
|
|
151
|
+
}
|
|
152
|
+
declare module "validation/common" {
|
|
153
|
+
export type DotvvmValidationContext = {
|
|
154
|
+
readonly valueToValidate: any;
|
|
155
|
+
readonly parentViewModel: any;
|
|
156
|
+
readonly parameters: any[];
|
|
157
|
+
};
|
|
158
|
+
export type DotvvmValidationObservableMetadata = DotvvmValidationElementMetadata[];
|
|
159
|
+
export type DotvvmValidationElementMetadata = {
|
|
160
|
+
element: HTMLElement;
|
|
161
|
+
dataType: string;
|
|
162
|
+
format: string;
|
|
163
|
+
domNodeDisposal: boolean;
|
|
164
|
+
elementValidationState: boolean;
|
|
165
|
+
};
|
|
166
|
+
export const errorsSymbol: unique symbol;
|
|
167
|
+
/** Checks if the value is null, undefined or a whitespace only string */
|
|
168
|
+
export function isEmpty(value: any): boolean;
|
|
169
|
+
export function getValidationMetadata(property: KnockoutObservable<any>): DotvvmValidationObservableMetadata;
|
|
170
|
+
}
|
|
171
|
+
declare module "utils/evaluator" {
|
|
172
|
+
/**
|
|
173
|
+
* Traverses provided context according to given path.
|
|
174
|
+
* @example / - returns context
|
|
175
|
+
* @example "" or null - returns context
|
|
176
|
+
* @example /exampleProp/A - returns prop A located withing property exampleProp located at provided context
|
|
177
|
+
* @example /exampleProp/B/1 - returns second item from collection B located within property exampleProp located at provided context
|
|
178
|
+
* @returns found property as unwrapped object
|
|
179
|
+
*/
|
|
180
|
+
export function traverseContext(context: any, path: string): any;
|
|
181
|
+
export function findPathToChildObservable(vm: any, child: any, path: string): string | null;
|
|
182
|
+
export function getDataSourceItems(viewModel: any): Array<KnockoutObservable<any>>;
|
|
183
|
+
export function wrapObservable(func: () => any, isArray?: boolean): KnockoutComputed<any>;
|
|
184
|
+
export const unwrapComputedProperty: (obs: any) => any;
|
|
185
|
+
}
|
|
186
|
+
declare module "validation/error" {
|
|
187
|
+
export const allErrors: ValidationError[];
|
|
188
|
+
export function detachAllErrors(): void;
|
|
189
|
+
export function getErrors<T>(o: KnockoutObservable<T> | null): ValidationError[];
|
|
190
|
+
export class ValidationError {
|
|
191
|
+
errorMessage: string;
|
|
192
|
+
propertyPath: string;
|
|
193
|
+
validatedObservable: KnockoutObservable<any>;
|
|
194
|
+
private constructor();
|
|
195
|
+
static attach(errorMessage: string, propertyPath: string, observable: KnockoutObservable<any>): ValidationError;
|
|
196
|
+
detach(): void;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
declare module "state-manager" {
|
|
200
|
+
import { DotvvmEvent } from "events";
|
|
201
|
+
export const currentStateSymbol: unique symbol;
|
|
202
|
+
export const notifySymbol: unique symbol;
|
|
203
|
+
export const lastSetErrorSymbol: unique symbol;
|
|
204
|
+
export const internalPropCache: unique symbol;
|
|
205
|
+
export const updateSymbol: unique symbol;
|
|
206
|
+
export const updatePropertySymbol: unique symbol;
|
|
207
|
+
export function getIsViewModelUpdating(): boolean;
|
|
208
|
+
export type UpdatableObjectExtensions<T> = {
|
|
209
|
+
[notifySymbol]: (newValue: T) => void;
|
|
210
|
+
[currentStateSymbol]: T;
|
|
211
|
+
[updateSymbol]?: UpdateDispatcher<T>;
|
|
212
|
+
};
|
|
213
|
+
export class StateManager<TViewModel extends {
|
|
214
|
+
$type?: TypeDefinition;
|
|
215
|
+
}> {
|
|
216
|
+
stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>;
|
|
217
|
+
readonly stateObservable: DeepKnockoutObservable<TViewModel>;
|
|
218
|
+
private _state;
|
|
219
|
+
get state(): DeepReadonly<TViewModel>;
|
|
220
|
+
private _isDirty;
|
|
221
|
+
get isDirty(): boolean;
|
|
222
|
+
private _currentFrameNumber;
|
|
223
|
+
constructor(initialState: DeepReadonly<TViewModel>, stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>);
|
|
224
|
+
dispatchUpdate(): void;
|
|
225
|
+
doUpdateNow(): void;
|
|
226
|
+
private rerender;
|
|
227
|
+
setState(newState: DeepReadonly<TViewModel>): DeepReadonly<TViewModel>;
|
|
228
|
+
patchState(patch: Partial<TViewModel>): DeepReadonly<TViewModel>;
|
|
229
|
+
update(updater: StateUpdate<TViewModel>): DeepReadonly<TViewModel>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Recursively unwraps knockout observables from the object / array hierarchy. When nothing needs to be unwrapped, the original object is returned.
|
|
233
|
+
* @param allowStateUnwrap Allows accessing [currentStateSymbol], which makes it faster, but doesn't register in the knockout dependency tracker
|
|
234
|
+
*/
|
|
235
|
+
export function unmapKnockoutObservables(viewModel: any, allowStateUnwrap?: boolean): any;
|
|
236
|
+
}
|
|
237
|
+
declare module "serialization/deserialize" {
|
|
238
|
+
export function deserialize(viewModel: any, target?: any, deserializeAll?: boolean): any;
|
|
239
|
+
export function deserializePrimitive(viewModel: any, target?: any): any;
|
|
240
|
+
export function deserializeDate(viewModel: any, target?: any): any;
|
|
241
|
+
export function deserializeArray(viewModel: any, target?: any, deserializeAll?: boolean): any;
|
|
242
|
+
export function deserializeObject(viewModel: any, target: any, deserializeAll: boolean): any;
|
|
243
|
+
export function extendToObservableArrayIfRequired(observable: any): any;
|
|
244
|
+
/** Clones only updatable properties from the object.
|
|
245
|
+
* Used after postback, to avoid updating properties which were sent to server, but weren't sent back. */
|
|
246
|
+
export function mapUpdatableProperties(viewModel: any, type?: TypeDefinition | undefined): any;
|
|
247
|
+
}
|
|
248
|
+
declare module "serialization/serialize" {
|
|
249
|
+
interface ISerializationOptions {
|
|
250
|
+
serializeAll?: boolean;
|
|
251
|
+
ignoreSpecialProperties?: boolean;
|
|
252
|
+
pathMatcher?: (vm: any) => boolean;
|
|
253
|
+
path?: string[];
|
|
254
|
+
pathOnly?: boolean;
|
|
255
|
+
restApiTarget?: boolean;
|
|
256
|
+
}
|
|
257
|
+
export function serialize(viewModel: any, opt?: ISerializationOptions): any;
|
|
258
|
+
export function serializeCore(viewModel: any, opt?: ISerializationOptions): any;
|
|
259
|
+
}
|
|
260
|
+
declare module "postback/resourceLoader" {
|
|
261
|
+
export type RenderedResourceList = {
|
|
262
|
+
[name: string]: string;
|
|
263
|
+
};
|
|
264
|
+
export function registerResources(rs: string[] | null | undefined): void;
|
|
265
|
+
export const getRenderedResources: () => string[];
|
|
266
|
+
export function loadResourceList(resources: RenderedResourceList | undefined): Promise<void>;
|
|
267
|
+
export function notifyModuleLoaded(id: number): void;
|
|
268
|
+
}
|
|
269
|
+
declare module "binding-handlers/textbox-text" {
|
|
270
|
+
const _default: {
|
|
271
|
+
"dotvvm-textbox-text": {
|
|
272
|
+
init(element: HTMLInputElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): void;
|
|
273
|
+
update(element: HTMLInputElement, valueAccessor: () => any): void;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
export default _default;
|
|
277
|
+
}
|
|
278
|
+
declare module "binding-handlers/textbox-select-all-on-focus" {
|
|
279
|
+
const _default_1: {
|
|
280
|
+
"dotvvm-textbox-select-all-on-focus": {
|
|
281
|
+
init(element: any): void;
|
|
282
|
+
update(element: any, valueAccessor: () => any): void;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
export default _default_1;
|
|
286
|
+
}
|
|
287
|
+
declare module "binding-handlers/SSR-foreach" {
|
|
288
|
+
type SeenUpdateElement = HTMLElement & {
|
|
289
|
+
seenUpdate?: number;
|
|
290
|
+
};
|
|
291
|
+
const _default_2: {
|
|
292
|
+
"dotvvm-SSR-foreach": {
|
|
293
|
+
init(element: Node, valueAccessor: () => any, allBindings?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext): {
|
|
294
|
+
controlsDescendantBindings: boolean;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
"dotvvm-SSR-item": {
|
|
298
|
+
init<T>(element: SeenUpdateElement, valueAccessor: () => T, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext): {
|
|
299
|
+
controlsDescendantBindings: boolean;
|
|
300
|
+
};
|
|
301
|
+
update(element: SeenUpdateElement): void;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
export default _default_2;
|
|
305
|
+
}
|
|
306
|
+
declare module "viewModules/viewModuleManager" {
|
|
307
|
+
type ModuleCommand = (...args: any) => Promise<unknown>;
|
|
308
|
+
export const viewModulesSymbol: unique symbol;
|
|
309
|
+
export function registerViewModule(name: string, moduleObject: any): void;
|
|
310
|
+
export function registerViewModules(modules: {
|
|
311
|
+
[name: string]: any;
|
|
312
|
+
}): void;
|
|
313
|
+
export function initViewModule(name: string, viewIdOrElement: string | HTMLElement, rootElement: HTMLElement, properties?: object): ModuleContext;
|
|
314
|
+
export function callViewModuleCommand(viewIdOrElement: string | HTMLElement, commandName: string, args: any[], allowAsync?: boolean): any;
|
|
315
|
+
export function findComponent(viewIdOrElement: null | string | HTMLElement, name: string): [ModuleContext | null, DotvvmJsComponentFactory];
|
|
316
|
+
export function registerGlobalComponent(name: string, c: DotvvmJsComponentFactory): void;
|
|
317
|
+
export function registerNamedCommand(viewIdOrElement: string | HTMLElement, commandName: string, command: ModuleCommand, rootElement: HTMLElement): void;
|
|
318
|
+
export function unregisterNamedCommand(viewIdOrElement: string | HTMLElement, commandName: string): void;
|
|
319
|
+
export class ModuleContext implements DotvvmModuleContext {
|
|
320
|
+
readonly moduleName: string;
|
|
321
|
+
readonly elements: HTMLElement[];
|
|
322
|
+
readonly properties: {
|
|
323
|
+
[name: string]: any;
|
|
324
|
+
};
|
|
325
|
+
readonly namedCommands: {
|
|
326
|
+
[name: string]: (...args: any[]) => Promise<any>;
|
|
327
|
+
};
|
|
328
|
+
module: any;
|
|
329
|
+
setState: (state: any) => void;
|
|
330
|
+
patchState: (state: any) => void;
|
|
331
|
+
updateState: (updateFunction: StateUpdate<any>) => void;
|
|
332
|
+
state: any;
|
|
333
|
+
constructor(moduleName: string, elements: HTMLElement[], properties: {
|
|
334
|
+
[name: string]: any;
|
|
335
|
+
}, viewModel: DotvvmObservable<any>);
|
|
336
|
+
registerNamedCommand: (name: string, command: (...args: any[]) => Promise<any>) => void;
|
|
337
|
+
unregisterNamedCommand: (name: string) => void;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
declare module "binding-handlers/markup-controls" {
|
|
341
|
+
export function wrapControlProperties(valueAccessor: () => any): any;
|
|
342
|
+
const _default_3: {
|
|
343
|
+
'dotvvm-with-control-properties': {
|
|
344
|
+
init: (element: HTMLElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
|
|
345
|
+
controlsDescendantBindings: boolean;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
'dotvvm-with-view-modules': {
|
|
349
|
+
init: (element: HTMLElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
|
|
350
|
+
controlsDescendantBindings: boolean;
|
|
351
|
+
} | undefined;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
export default _default_3;
|
|
355
|
+
}
|
|
356
|
+
declare module "binding-handlers/table-columnvisible" {
|
|
357
|
+
const _default_4: {
|
|
358
|
+
'dotvvm-table-columnvisible': {
|
|
359
|
+
init(element: HTMLElement, valueAccessor: () => any): void;
|
|
360
|
+
update(element: any, valueAccessor: any): void;
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
export default _default_4;
|
|
364
|
+
}
|
|
365
|
+
declare module "binding-handlers/enable" {
|
|
366
|
+
const _default_5: {
|
|
367
|
+
'dotvvm-enable': {
|
|
368
|
+
update: (element: HTMLInputElement, valueAccessor: () => KnockoutObservable<boolean>) => void;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
export default _default_5;
|
|
372
|
+
}
|
|
373
|
+
declare module "binding-handlers/checkbox" {
|
|
374
|
+
const _default_6: {
|
|
375
|
+
'dotvvm-checkbox-updateAfterPostback': {
|
|
376
|
+
init(element: HTMLElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): void;
|
|
377
|
+
};
|
|
378
|
+
'dotvvm-checked-pointer': {};
|
|
379
|
+
"dotvvm-CheckState": {
|
|
380
|
+
init: ((element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | {
|
|
381
|
+
controlsDescendantBindings: boolean;
|
|
382
|
+
}) | undefined;
|
|
383
|
+
update(element: any, valueAccessor: () => any): void;
|
|
384
|
+
};
|
|
385
|
+
"dotvvm-checkedItems": {
|
|
386
|
+
after: string[] | undefined;
|
|
387
|
+
init: ((element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | {
|
|
388
|
+
controlsDescendantBindings: boolean;
|
|
389
|
+
}) | undefined;
|
|
390
|
+
options: any;
|
|
391
|
+
update(element: any, valueAccessor: () => any): void;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
export default _default_6;
|
|
395
|
+
}
|
|
396
|
+
declare module "postback/queue" {
|
|
397
|
+
export const updateProgressChangeCounter: KnockoutObservable<number>;
|
|
398
|
+
export const postbackQueues: {
|
|
399
|
+
[name: string]: {
|
|
400
|
+
queue: Array<(() => void)>;
|
|
401
|
+
noRunning: number;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
export function getPostbackQueue(name?: string): {
|
|
405
|
+
queue: (() => void)[];
|
|
406
|
+
noRunning: number;
|
|
407
|
+
};
|
|
408
|
+
export function enterActivePostback(queueName: string): void;
|
|
409
|
+
export function leaveActivePostback(queueName: string): void;
|
|
410
|
+
export function runNextInQueue(queueName: string): void;
|
|
411
|
+
}
|
|
412
|
+
declare module "binding-handlers/update-progress" {
|
|
413
|
+
const _default_7: {
|
|
414
|
+
"dotvvm-UpdateProgress-Visible": {
|
|
415
|
+
init(element: HTMLElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext): void;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
export default _default_7;
|
|
419
|
+
}
|
|
420
|
+
declare module "binding-handlers/gridviewdataset" {
|
|
421
|
+
const _default_8: {
|
|
422
|
+
"dotvvm-gridviewdataset": {
|
|
423
|
+
init: (element: Node, valueAccessor: () => any, allBindings: KnockoutAllBindingsAccessor | undefined, _viewModel: any, bindingContext: KnockoutBindingContext | undefined) => {
|
|
424
|
+
controlsDescendantBindings: boolean;
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
export default _default_8;
|
|
429
|
+
}
|
|
430
|
+
declare module "binding-handlers/named-command" {
|
|
431
|
+
const _default_9: {
|
|
432
|
+
'dotvvm-named-command': {
|
|
433
|
+
init: (element: HTMLElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
|
|
434
|
+
controlsDescendantBindings: boolean;
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
export default _default_9;
|
|
439
|
+
}
|
|
440
|
+
declare module "binding-handlers/file-upload" {
|
|
441
|
+
const _default_10: {
|
|
442
|
+
"dotvvm-FileUpload": {
|
|
443
|
+
init: (element: HTMLInputElement, valueAccessor: () => any, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => void;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
export default _default_10;
|
|
447
|
+
}
|
|
448
|
+
declare module "binding-handlers/js-component" {
|
|
449
|
+
const _default_11: {
|
|
450
|
+
"dotvvm-js-component": {
|
|
451
|
+
init(element: HTMLInputElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): {
|
|
452
|
+
controlsDescendantBindings: boolean;
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
export default _default_11;
|
|
457
|
+
}
|
|
458
|
+
declare module "binding-handlers/modal-dialog" {
|
|
459
|
+
const _default_12: {
|
|
460
|
+
"dotvvm-modal-open": {
|
|
461
|
+
init(element: HTMLDialogElement, valueAccessor: () => any): void;
|
|
462
|
+
update(element: HTMLDialogElement, valueAccessor: () => any): void;
|
|
463
|
+
};
|
|
464
|
+
"dotvvm-modal-backdrop-close": {
|
|
465
|
+
init(element: HTMLDialogElement, valueAccessor: () => any): void;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
export default _default_12;
|
|
469
|
+
}
|
|
470
|
+
declare module "binding-handlers/all-handlers" {
|
|
471
|
+
type KnockoutHandlerDictionary = {
|
|
472
|
+
[name: string]: KnockoutBindingHandler;
|
|
473
|
+
};
|
|
474
|
+
const allHandlers: KnockoutHandlerDictionary;
|
|
475
|
+
export default allHandlers;
|
|
476
|
+
}
|
|
477
|
+
declare module "spa/events" {
|
|
478
|
+
import { DotvvmEvent } from "events";
|
|
479
|
+
export const spaNavigating: DotvvmEvent<DotvvmSpaNavigatingEventArgs>;
|
|
480
|
+
export const spaNavigated: DotvvmEvent<DotvvmSpaNavigatedEventArgs>;
|
|
481
|
+
export const spaNavigationFailed: DotvvmEvent<DotvvmSpaNavigationFailedEventArgs>;
|
|
482
|
+
}
|
|
483
|
+
declare module "dotvvm-base" {
|
|
484
|
+
import { StateManager } from "state-manager";
|
|
485
|
+
export const options: {
|
|
486
|
+
compressPOST: boolean;
|
|
487
|
+
};
|
|
488
|
+
export function getViewModel(): DeepKnockoutObservableObject<RootViewModel>;
|
|
489
|
+
export function getViewModelCacheId(): string | undefined;
|
|
490
|
+
export function getViewModelCache(): any;
|
|
491
|
+
export function getViewModelObservable(): DeepKnockoutObservable<RootViewModel>;
|
|
492
|
+
export function getInitialUrl(): string;
|
|
493
|
+
export function getVirtualDirectory(): string;
|
|
494
|
+
export function replaceViewModel(vm: RootViewModel): void;
|
|
495
|
+
export function getState(): Readonly<RootViewModel>;
|
|
496
|
+
export function updateViewModelCache(viewModelCacheId: string, viewModelCache: any): void;
|
|
497
|
+
export function clearViewModelCache(): void;
|
|
498
|
+
export function getCulture(): string;
|
|
499
|
+
export function getStateManager(): StateManager<RootViewModel>;
|
|
500
|
+
export function initCore(culture: string): void;
|
|
501
|
+
export function initBindings(): void;
|
|
502
|
+
}
|
|
503
|
+
declare module "DotVVM.Globalize" {
|
|
504
|
+
import { parseDate as serializationParseDate } from "serialization/date";
|
|
505
|
+
export function format(format: string, ...values: any[]): string;
|
|
506
|
+
type GlobalizeFormattable = null | undefined | string | Date | number;
|
|
507
|
+
export function formatString(format: string | null | undefined, value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, type: string | null): string;
|
|
508
|
+
export function parseNumber(value: string): number;
|
|
509
|
+
export function parseDate(value: string, format: string, previousValue?: Date | null): Date | null;
|
|
510
|
+
export const parseDotvvmDate: typeof serializationParseDate;
|
|
511
|
+
export function bindingDateToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
|
|
512
|
+
export function bindingDateOnlyToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
|
|
513
|
+
export function bindingTimeOnlyToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
|
|
514
|
+
export function bindingNumberToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
|
|
515
|
+
}
|
|
516
|
+
declare var compileConstants: {
|
|
517
|
+
/** If the compiled bundle is for SPA applications */
|
|
518
|
+
isSpa: boolean;
|
|
519
|
+
/** If the compiled bundle is unminified */
|
|
520
|
+
debug: boolean;
|
|
521
|
+
};
|
|
522
|
+
declare module "utils/uri" {
|
|
523
|
+
export function removeVirtualDirectoryFromUrl(url: string): string;
|
|
524
|
+
export function addVirtualDirectoryToUrl(appRelativeUrl: string): string;
|
|
525
|
+
export function addLeadingSlash(url: string): string;
|
|
526
|
+
export function concatUrl(url1: string, url2: string): string;
|
|
527
|
+
}
|
|
528
|
+
declare module "postback/http" {
|
|
529
|
+
export type WrappedResponse<T> = {
|
|
530
|
+
readonly result: T;
|
|
531
|
+
readonly response?: Response;
|
|
532
|
+
};
|
|
533
|
+
export function getJSON<T>(url: string, spaPlaceHolderUniqueId?: string, signal?: AbortSignal, additionalHeaders?: {
|
|
534
|
+
[key: string]: string;
|
|
535
|
+
}): Promise<WrappedResponse<T>>;
|
|
536
|
+
export function postJSON<T>(url: string, postData: any, signal: AbortSignal | undefined, additionalHeaders?: {
|
|
537
|
+
[key: string]: string;
|
|
538
|
+
}): Promise<WrappedResponse<T>>;
|
|
539
|
+
export function fetchJson<T>(url: string, init: RequestInit): Promise<WrappedResponse<T>>;
|
|
540
|
+
export function fetchCsrfToken(signal: AbortSignal | undefined): Promise<string>;
|
|
541
|
+
export function retryOnInvalidCsrfToken<TResult>(postbackFunction: () => Promise<TResult>, iteration?: number, customErrorHandler?: () => void): Promise<TResult>;
|
|
542
|
+
}
|
|
543
|
+
declare module "postback/counter" {
|
|
544
|
+
export function backUpPostBackCounter(): number;
|
|
545
|
+
}
|
|
546
|
+
declare module "utils/magic-navigator" {
|
|
547
|
+
export function navigate(url: string): void;
|
|
548
|
+
}
|
|
549
|
+
declare module "postback/redirect" {
|
|
550
|
+
export function performRedirect(url: string, replace: boolean, allowSpa: boolean): Promise<any>;
|
|
551
|
+
export function handleRedirect(options: PostbackOptions, resultObject: any, response: Response, replace?: boolean): Promise<DotvvmRedirectEventArgs>;
|
|
552
|
+
}
|
|
553
|
+
declare module "postback/gate" {
|
|
554
|
+
export function isPostbackDisabled(postbackId: number): boolean;
|
|
555
|
+
export function enablePostbacks(): void;
|
|
556
|
+
export function disablePostbacks(): void;
|
|
557
|
+
}
|
|
558
|
+
declare module "validation/validators" {
|
|
559
|
+
import { DotvvmValidationContext } from "validation/common";
|
|
560
|
+
export type DotvvmValidator = {
|
|
561
|
+
isValid: (value: any, context: DotvvmValidationContext, property: KnockoutObservable<any>) => boolean;
|
|
562
|
+
};
|
|
563
|
+
export const required: DotvvmValidator;
|
|
564
|
+
export const regex: DotvvmValidator;
|
|
565
|
+
export const enforceClientFormat: DotvvmValidator;
|
|
566
|
+
export const range: DotvvmValidator;
|
|
567
|
+
export const notNull: DotvvmValidator;
|
|
568
|
+
export const emailAddress: DotvvmValidator;
|
|
569
|
+
type DotvvmValidatorSet = {
|
|
570
|
+
[name: string]: DotvvmValidator;
|
|
571
|
+
};
|
|
572
|
+
export const validators: DotvvmValidatorSet;
|
|
573
|
+
}
|
|
574
|
+
declare module "postback/internal-handlers" {
|
|
575
|
+
export const isPostbackRunning: KnockoutObservable<boolean>;
|
|
576
|
+
export const suppressOnDisabledElementHandler: DotvvmPostbackHandler;
|
|
577
|
+
export const isPostBackRunningHandler: DotvvmPostbackHandler;
|
|
578
|
+
export const concurrencyDefault: (o: any) => {
|
|
579
|
+
name: string;
|
|
580
|
+
before: string[];
|
|
581
|
+
execute: (next: () => Promise<PostbackCommitFunction>, options: PostbackOptions) => Promise<PostbackCommitFunction>;
|
|
582
|
+
};
|
|
583
|
+
export const concurrencyDeny: (o: any) => {
|
|
584
|
+
name: string;
|
|
585
|
+
before: string[];
|
|
586
|
+
execute(next: () => Promise<PostbackCommitFunction>, options: PostbackOptions): Promise<PostbackCommitFunction>;
|
|
587
|
+
};
|
|
588
|
+
export const concurrencyQueue: (o: any) => {
|
|
589
|
+
name: string;
|
|
590
|
+
before: string[];
|
|
591
|
+
execute(next: () => Promise<PostbackCommitFunction>, options: PostbackOptions): Promise<PostbackCommitFunction>;
|
|
592
|
+
};
|
|
593
|
+
export const suppressOnUpdating: (o: any) => {
|
|
594
|
+
name: string;
|
|
595
|
+
before: string[];
|
|
596
|
+
execute(next: () => Promise<PostbackCommitFunction>, options: PostbackOptions): Promise<PostbackCommitFunction>;
|
|
597
|
+
};
|
|
598
|
+
export function isPostbackStillActive(options: PostbackOptions): boolean;
|
|
599
|
+
}
|
|
600
|
+
declare module "postback/handlers" {
|
|
601
|
+
class ConfirmPostBackHandler implements DotvvmPostbackHandler {
|
|
602
|
+
message: string;
|
|
603
|
+
constructor(message: string);
|
|
604
|
+
execute<T>(next: () => Promise<T>, options: PostbackOptions): Promise<T>;
|
|
605
|
+
}
|
|
606
|
+
class SuppressPostBackHandler implements DotvvmPostbackHandler {
|
|
607
|
+
suppress: boolean;
|
|
608
|
+
constructor(suppress: boolean);
|
|
609
|
+
execute<T>(next: () => Promise<T>, options: PostbackOptions): Promise<T>;
|
|
610
|
+
}
|
|
611
|
+
export const confirm: (options: any) => ConfirmPostBackHandler;
|
|
612
|
+
export const suppress: (options: any) => SuppressPostBackHandler;
|
|
613
|
+
export const timeout: (options: any) => DotvvmPostbackHandler;
|
|
614
|
+
export const postbackHandlers: DotvvmPostbackHandlerCollection;
|
|
615
|
+
export function getPostbackHandler(name: string): (options: any) => DotvvmPostbackHandler;
|
|
616
|
+
export const defaultConcurrencyPostbackHandler: DotvvmPostbackHandler;
|
|
617
|
+
}
|
|
618
|
+
declare module "validation/actions" {
|
|
619
|
+
type DotvvmValidationActions = {
|
|
620
|
+
[name: string]: (element: HTMLElement, errorMessages: string[], param: any) => void;
|
|
621
|
+
};
|
|
622
|
+
export const elementActions: DotvvmValidationActions;
|
|
623
|
+
}
|
|
624
|
+
declare module "validation/validation" {
|
|
625
|
+
import { ValidationError } from "validation/error";
|
|
626
|
+
import { DotvvmEvent } from "events";
|
|
627
|
+
type DotvvmValidationErrorsChangedEventArgs = Partial<PostbackOptions> & {
|
|
628
|
+
readonly allErrors: ValidationError[];
|
|
629
|
+
};
|
|
630
|
+
export const events: {
|
|
631
|
+
validationErrorsChanged: DotvvmEvent<DotvvmValidationErrorsChangedEventArgs>;
|
|
632
|
+
};
|
|
633
|
+
export const globalValidationObject: {
|
|
634
|
+
/** Dictionary of client-side validation rules. Add new items to this object if you want to add support for new validation rules */
|
|
635
|
+
rules: {
|
|
636
|
+
[name: string]: import("validation/validators").DotvvmValidator;
|
|
637
|
+
};
|
|
638
|
+
/** List of all currently active errors */
|
|
639
|
+
errors: ValidationError[];
|
|
640
|
+
events: {
|
|
641
|
+
validationErrorsChanged: DotvvmEvent<DotvvmValidationErrorsChangedEventArgs>;
|
|
642
|
+
};
|
|
643
|
+
/** Add the specified list of validation errors. `dotvvm.validation.addErrors([ { errorMessage: "test error", propertyPath: "/LoginForm/Name" } ])` */
|
|
644
|
+
addErrors: typeof addErrors;
|
|
645
|
+
/** Removes errors from the specified properties.
|
|
646
|
+
* The errors are removed recursively, so calling `dotvvm.validation.removeErrors("/")` removes all errors in the page,
|
|
647
|
+
* `dotvvm.validation.removeErrors("/Detail")` removes all errors from the object in property root.Detail */
|
|
648
|
+
removeErrors: typeof removeErrors;
|
|
649
|
+
};
|
|
650
|
+
export function init(): void;
|
|
651
|
+
export type ValidationErrorDescriptor = {
|
|
652
|
+
/** Error to be displayed to the user */
|
|
653
|
+
errorMessage: string;
|
|
654
|
+
/** Path in the view model to the annotated property, for example `/LoginPage/Name` */
|
|
655
|
+
propertyPath: string;
|
|
656
|
+
};
|
|
657
|
+
export type AddErrorsOptions = {
|
|
658
|
+
/** Root object from which are the property paths resolved. By default it's the root view model of the page */
|
|
659
|
+
root?: KnockoutObservable<any> | any;
|
|
660
|
+
/** When set to false, the validationErrorsChanged is not triggered. By default it's true -> the error is triggered.
|
|
661
|
+
* The validationErrorsChanged event controls the `Validator`s in the DotHTML page, so when it's not triggered, the change won't be visible. */
|
|
662
|
+
triggerErrorsChanged?: false;
|
|
663
|
+
};
|
|
664
|
+
export function removeErrors(...paths: string[]): void;
|
|
665
|
+
export function addErrors(errors: ValidationErrorDescriptor[], options?: AddErrorsOptions): void;
|
|
666
|
+
/**
|
|
667
|
+
* Adds validation errors from the server to the appropriate arrays
|
|
668
|
+
*/
|
|
669
|
+
export function showValidationErrorsFromServer(serverResponseObject: any, options: PostbackOptions): void;
|
|
670
|
+
}
|
|
671
|
+
declare module "postback/postbackCore" {
|
|
672
|
+
export function throwIfAborted(options: PostbackOptions): void;
|
|
673
|
+
export function getLastStartedPostbackId(): number;
|
|
674
|
+
export function postbackCore(options: PostbackOptions, path: string[], command: string, controlUniqueId: string, context: any, commandArgs?: any[]): Promise<PostbackCommitFunction>;
|
|
675
|
+
}
|
|
676
|
+
declare module "postback/postback" {
|
|
677
|
+
export function postBack(sender: HTMLElement, path: string[], command: string, controlUniqueId: string, context?: any, handlers?: ClientFriendlyPostbackHandlerConfiguration[], commandArgs?: any[], abortSignal?: AbortSignal): Promise<DotvvmAfterPostBackEventArgs>;
|
|
678
|
+
type MaybePromise<T> = Promise<T> | T;
|
|
679
|
+
export function applyPostbackHandlers(next: (options: PostbackOptions) => MaybePromise<PostbackCommitFunction | any>, sender: HTMLElement, handlerConfigurations?: ClientFriendlyPostbackHandlerConfiguration[], args?: any[], context?: any, abortSignal?: AbortSignal): Promise<DotvvmAfterPostBackEventArgs>;
|
|
680
|
+
export function isPostbackHandler(obj: any): obj is DotvvmPostbackHandler;
|
|
681
|
+
export function sortHandlers(handlers: DotvvmPostbackHandler[]): DotvvmPostbackHandler[];
|
|
682
|
+
}
|
|
683
|
+
declare module "api/eventHub" {
|
|
684
|
+
export function notify(id: string): void;
|
|
685
|
+
export function get(id: string): KnockoutObservable<number>;
|
|
686
|
+
}
|
|
687
|
+
declare module "api/api" {
|
|
688
|
+
type ApiComputed<T> = KnockoutComputed<T | null> & {
|
|
689
|
+
refreshValue: () => PromiseLike<any>;
|
|
690
|
+
};
|
|
691
|
+
export const isLoading: KnockoutObservable<boolean>;
|
|
692
|
+
export function invoke<T>(target: any, methodName: string, argsProvider: () => any[], refreshTriggers: (args: any[]) => Array<KnockoutObservable<any> | string>, notifyTriggers: (args: any[]) => string[], cacheElement: HTMLElement, sharingKeyProvider: (args: any[]) => string[], lifetimeElement: HTMLElement): ApiComputed<T>;
|
|
693
|
+
export function refreshOn<T>(value: ApiComputed<T>, watch: KnockoutObservable<any>): ApiComputed<T>;
|
|
694
|
+
export function clearApiCachedValues(): void;
|
|
695
|
+
}
|
|
696
|
+
declare module "spa/navigation" {
|
|
697
|
+
export function navigateCore(url: string, options: PostbackOptions, handlePageNavigating: (url: string) => void): Promise<DotvvmNavigationEventArgs>;
|
|
698
|
+
}
|
|
699
|
+
declare module "spa/spa" {
|
|
700
|
+
export const isSpaReady: KnockoutObservable<boolean>;
|
|
701
|
+
export function init(): void;
|
|
702
|
+
export function getSpaPlaceHoldersUniqueId(): string;
|
|
703
|
+
export function handleSpaNavigation(element: HTMLElement): Promise<DotvvmNavigationEventArgs | undefined>;
|
|
704
|
+
export function handleSpaNavigationCore(url: string | null, sender?: HTMLElement, handlePageNavigating?: (url: string) => void): Promise<DotvvmNavigationEventArgs>;
|
|
705
|
+
}
|
|
706
|
+
declare module "binding-handlers/register" {
|
|
707
|
+
const _default_13: () => void;
|
|
708
|
+
export default _default_13;
|
|
709
|
+
}
|
|
710
|
+
declare module "postback/staticCommand" {
|
|
711
|
+
export function resolveRelativeValidationPaths(paths: string[] | null | undefined, context: KnockoutBindingContext | undefined): (string | null)[] | undefined;
|
|
712
|
+
export function staticCommandPostback(command: string, args: any[], options: PostbackOptions, paths: string[] | null | undefined): Promise<any>;
|
|
713
|
+
}
|
|
714
|
+
declare module "controls/routeLink" {
|
|
715
|
+
export function buildRouteUrl(routePath: string, params: any): string;
|
|
716
|
+
export function buildUrlSuffix(urlSuffix: string, query: any): string;
|
|
717
|
+
}
|
|
718
|
+
declare module "controls/fileUpload" {
|
|
719
|
+
export function showUploadDialog(sender: HTMLElement): void;
|
|
720
|
+
export function reportProgress(inputControl: HTMLInputElement, isBusy: boolean, progress: number, result: DotvvmStaticCommandResponse<DotvvmFileUploadData[]> | string): void;
|
|
721
|
+
}
|
|
722
|
+
declare module "metadata/metadataHelper" {
|
|
723
|
+
export function getTypeId(viewModel: object): string | undefined;
|
|
724
|
+
export function getTypeMetadata(typeId: string | object): TypeMetadata;
|
|
725
|
+
export function getEnumMetadata(enumMetadataId: string): EnumTypeMetadata;
|
|
726
|
+
}
|
|
727
|
+
declare module "translations/sortingHelper" {
|
|
728
|
+
type ElementType = string | number | boolean;
|
|
729
|
+
export const orderBy: <T>(array: T[], selector: (item: T) => ElementType, typeId: string) => T[];
|
|
730
|
+
export const orderByDesc: <T>(array: T[], selector: (item: T) => ElementType, typeId: string) => T[];
|
|
731
|
+
}
|
|
732
|
+
declare module "translations/arrayHelper" {
|
|
733
|
+
import { orderBy, orderByDesc } from "translations/sortingHelper";
|
|
734
|
+
export { add, addOrUpdate, addRange, clear, distinct, contains, firstOrDefault, insert, insertRange, lastOrDefault, max, min, orderBy, orderByDesc, removeAll, removeAt, removeFirst, removeLast, removeRange, reverse, setItem };
|
|
735
|
+
function add<T>(observable: any, element: T): void;
|
|
736
|
+
function addOrUpdate<T>(observable: any, element: T, matcher: (e: T) => boolean, updater: (e: T) => T): void;
|
|
737
|
+
function addRange<T>(observable: any, elements: T[]): void;
|
|
738
|
+
function clear(observable: any): void;
|
|
739
|
+
function distinct<T>(array: T[]): T[];
|
|
740
|
+
function contains<T>(array: T[], value: T): boolean;
|
|
741
|
+
function firstOrDefault<T>(array: T[], predicate: (s: T) => boolean): T | null;
|
|
742
|
+
function insert<T>(observable: any, index: number, element: T): void;
|
|
743
|
+
function insertRange<T>(observable: any, index: number, elements: T[]): void;
|
|
744
|
+
function lastOrDefault<T>(array: T[], predicate: (s: T) => boolean): T | null;
|
|
745
|
+
function max<T>(array: T[], selector: (item: T) => number, throwIfEmpty: boolean): number | null;
|
|
746
|
+
function min<T>(array: T[], selector: (item: T) => number, throwIfEmpty: boolean): number | null;
|
|
747
|
+
function removeAt<T>(observable: any, index: number): void;
|
|
748
|
+
function removeAll<T>(observable: any, predicate: (s: T) => boolean): void;
|
|
749
|
+
function removeRange<T>(observable: any, index: number, length: number): void;
|
|
750
|
+
function removeFirst<T>(observable: any, predicate: (s: T) => boolean): void;
|
|
751
|
+
function removeLast<T>(observable: any, predicate: (s: T) => boolean): void;
|
|
752
|
+
function reverse<T>(observable: any): void;
|
|
753
|
+
function setItem<T>(observable: any, index: number, value: T): void;
|
|
754
|
+
}
|
|
755
|
+
declare module "translations/dictionaryHelper" {
|
|
756
|
+
type Dictionary<Key, Value> = {
|
|
757
|
+
Key: Key;
|
|
758
|
+
Value: Value;
|
|
759
|
+
}[];
|
|
760
|
+
export function clear(observable: any): void;
|
|
761
|
+
export function containsKey<Key, Value>(dictionary: Dictionary<Key, Value>, identifier: Key): boolean;
|
|
762
|
+
export function getItem<Key, Value>(dictionary: Dictionary<Key, Value>, identifier: Key, defaultValue?: Value): Value;
|
|
763
|
+
export function remove<Key, Value>(observable: any, identifier: Key): boolean;
|
|
764
|
+
export function setItem<Key, Value>(observable: any, identifier: Key, value: Value): void;
|
|
765
|
+
}
|
|
766
|
+
declare module "translations/stringHelper" {
|
|
767
|
+
export function contains(haystack: string, needle: string, options: string): boolean;
|
|
768
|
+
export function endsWith(haystack: string, needle: string, options: string): boolean;
|
|
769
|
+
export function startsWith(haystack: string, needle: string, options: string): boolean;
|
|
770
|
+
export function indexOf(haystack: string, startIndex: number, needle: string, options: string): number;
|
|
771
|
+
export function lastIndexOf(haystack: string, startIndex: number, needle: string, options: string): number;
|
|
772
|
+
export function split(text: string, delimiter: string, options: string): string[];
|
|
773
|
+
export function join<T>(elements: T[], delimiter: string): string;
|
|
774
|
+
export function format(pattern: string, expressions: any[]): string;
|
|
775
|
+
export function trimStart(text: string, char: string): string;
|
|
776
|
+
export function trimEnd(text: string, char: string): string;
|
|
777
|
+
}
|
|
778
|
+
declare module "translations/dateTimeHelper" {
|
|
779
|
+
export function toBrowserLocalTime(value: KnockoutObservable<string | null>): KnockoutComputed<string | null>;
|
|
780
|
+
}
|
|
781
|
+
declare module "translations/translations" {
|
|
782
|
+
import * as array from "translations/arrayHelper";
|
|
783
|
+
import * as dictionary from "translations/dictionaryHelper";
|
|
784
|
+
import * as string from "translations/stringHelper";
|
|
785
|
+
import * as dateTime from "translations/dateTimeHelper";
|
|
786
|
+
const _default_14: Readonly<{
|
|
787
|
+
array: typeof array;
|
|
788
|
+
dictionary: typeof dictionary;
|
|
789
|
+
string: typeof string;
|
|
790
|
+
dateTime: typeof dateTime;
|
|
791
|
+
enums: {
|
|
792
|
+
fromInt(value: any, type: string): any;
|
|
793
|
+
toInt(value: any, type: string): number | null;
|
|
794
|
+
};
|
|
795
|
+
}>;
|
|
796
|
+
export default _default_14;
|
|
797
|
+
}
|
|
798
|
+
declare module "dotvvm-root" {
|
|
799
|
+
import { getCulture } from "dotvvm-base";
|
|
800
|
+
import * as events from "events";
|
|
801
|
+
import * as validation from "validation/validation";
|
|
802
|
+
import { postBack } from "postback/postback";
|
|
803
|
+
import { serialize } from "serialization/serialize";
|
|
804
|
+
import { serializeDate, parseDate } from "serialization/date";
|
|
805
|
+
import { deserialize } from "serialization/deserialize";
|
|
806
|
+
import * as evaluator from "utils/evaluator";
|
|
807
|
+
import * as globalize from "DotVVM.Globalize";
|
|
808
|
+
import { staticCommandPostback } from "postback/staticCommand";
|
|
809
|
+
import { applyPostbackHandlers } from "postback/postback";
|
|
810
|
+
import { isSpaReady } from "spa/spa";
|
|
811
|
+
import { buildRouteUrl, buildUrlSuffix } from "controls/routeLink";
|
|
812
|
+
import * as fileUpload from "controls/fileUpload";
|
|
813
|
+
import { handleSpaNavigation } from "spa/spa";
|
|
814
|
+
import * as spaEvents from "spa/events";
|
|
815
|
+
import * as api from "api/api";
|
|
816
|
+
import * as eventHub from "api/eventHub";
|
|
817
|
+
import * as viewModuleManager from "viewModules/viewModuleManager";
|
|
818
|
+
import { notifyModuleLoaded } from "postback/resourceLoader";
|
|
819
|
+
import { logError, logWarning, logInfo, logInfoVerbose, logPostBackScriptError } from "utils/logging";
|
|
820
|
+
import * as metadataHelper from "metadata/metadataHelper";
|
|
821
|
+
import { StateManager } from "state-manager";
|
|
822
|
+
function init(culture: string): void;
|
|
823
|
+
const dotvvmExports: {
|
|
824
|
+
getCulture: typeof getCulture;
|
|
825
|
+
evaluator: {
|
|
826
|
+
getDataSourceItems: typeof evaluator.getDataSourceItems;
|
|
827
|
+
wrapObservable: typeof evaluator.wrapObservable;
|
|
828
|
+
};
|
|
829
|
+
fileUpload: {
|
|
830
|
+
reportProgress: typeof fileUpload.reportProgress;
|
|
831
|
+
showUploadDialog: typeof fileUpload.showUploadDialog;
|
|
832
|
+
};
|
|
833
|
+
api: {
|
|
834
|
+
isLoading: KnockoutObservable<boolean>;
|
|
835
|
+
invoke: typeof api.invoke;
|
|
836
|
+
refreshOn: typeof api.refreshOn;
|
|
837
|
+
};
|
|
838
|
+
eventHub: {
|
|
839
|
+
get: typeof eventHub.get;
|
|
840
|
+
notify: typeof eventHub.notify;
|
|
841
|
+
};
|
|
842
|
+
globalize: typeof globalize;
|
|
843
|
+
postBackHandlers: DotvvmPostbackHandlerCollection;
|
|
844
|
+
postbackHandlers: DotvvmPostbackHandlerCollection;
|
|
845
|
+
buildUrlSuffix: typeof buildUrlSuffix;
|
|
846
|
+
buildRouteUrl: typeof buildRouteUrl;
|
|
847
|
+
staticCommandPostback: typeof staticCommandPostback;
|
|
848
|
+
applyPostbackHandlers: typeof applyPostbackHandlers;
|
|
849
|
+
validation: {
|
|
850
|
+
rules: {
|
|
851
|
+
[name: string]: import("validation/validators").DotvvmValidator;
|
|
852
|
+
};
|
|
853
|
+
errors: import("validation/error").ValidationError[];
|
|
854
|
+
events: {
|
|
855
|
+
validationErrorsChanged: events.DotvvmEvent<Partial<PostbackOptions> & {
|
|
856
|
+
readonly allErrors: import("validation/error").ValidationError[];
|
|
857
|
+
}>;
|
|
858
|
+
};
|
|
859
|
+
addErrors: typeof validation.addErrors;
|
|
860
|
+
removeErrors: typeof validation.removeErrors;
|
|
861
|
+
};
|
|
862
|
+
postBack: typeof postBack;
|
|
863
|
+
init: typeof init;
|
|
864
|
+
registerGlobalComponent: typeof viewModuleManager.registerGlobalComponent;
|
|
865
|
+
isPostbackRunning: KnockoutObservable<boolean>;
|
|
866
|
+
events: Partial<typeof spaEvents> & typeof events;
|
|
867
|
+
viewModels: {
|
|
868
|
+
root: {
|
|
869
|
+
readonly viewModel: DeepKnockoutObservableObject<RootViewModel>;
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
readonly state: Readonly<RootViewModel>;
|
|
873
|
+
patchState(a: any): void;
|
|
874
|
+
setState(a: any): void;
|
|
875
|
+
updateState(updateFunction: StateUpdate<any>): void;
|
|
876
|
+
viewModelObservables: {
|
|
877
|
+
readonly root: KnockoutObservable<DeepKnockoutObservableObject<RootViewModel>>;
|
|
878
|
+
};
|
|
879
|
+
serialization: {
|
|
880
|
+
serialize: typeof serialize;
|
|
881
|
+
serializeDate: typeof serializeDate;
|
|
882
|
+
parseDate: typeof parseDate;
|
|
883
|
+
deserialize: typeof deserialize;
|
|
884
|
+
};
|
|
885
|
+
metadata: {
|
|
886
|
+
getTypeId: typeof metadataHelper.getTypeId;
|
|
887
|
+
getTypeMetadata: typeof metadataHelper.getTypeMetadata;
|
|
888
|
+
getEnumMetadata: typeof metadataHelper.getEnumMetadata;
|
|
889
|
+
};
|
|
890
|
+
viewModules: {
|
|
891
|
+
registerOne: typeof viewModuleManager.registerViewModule;
|
|
892
|
+
init: typeof viewModuleManager.initViewModule;
|
|
893
|
+
call: typeof viewModuleManager.callViewModuleCommand;
|
|
894
|
+
registerMany: typeof viewModuleManager.registerViewModules;
|
|
895
|
+
};
|
|
896
|
+
resourceLoader: {
|
|
897
|
+
notifyModuleLoaded: typeof notifyModuleLoaded;
|
|
898
|
+
};
|
|
899
|
+
log: {
|
|
900
|
+
logError: typeof logError;
|
|
901
|
+
logWarning: typeof logWarning;
|
|
902
|
+
logInfo: typeof logInfo;
|
|
903
|
+
logInfoVerbose: typeof logInfoVerbose;
|
|
904
|
+
logPostBackScriptError: typeof logPostBackScriptError;
|
|
905
|
+
level: "normal" | "verbose";
|
|
906
|
+
};
|
|
907
|
+
options: {
|
|
908
|
+
compressPOST: boolean;
|
|
909
|
+
};
|
|
910
|
+
translations: any;
|
|
911
|
+
StateManager: typeof StateManager;
|
|
912
|
+
DotvvmEvent: typeof events.DotvvmEvent;
|
|
913
|
+
};
|
|
914
|
+
global {
|
|
915
|
+
interface DotvvmGlobalExtensions {
|
|
916
|
+
}
|
|
917
|
+
type DotvvmGlobal = DotvvmGlobalExtensions & typeof dotvvmExports & DotvvmStateContainer<any> & {
|
|
918
|
+
debug?: true;
|
|
919
|
+
isSpaReady?: typeof isSpaReady;
|
|
920
|
+
handleSpaNavigation?: typeof handleSpaNavigation;
|
|
921
|
+
};
|
|
922
|
+
const dotvvm: DotvvmGlobal;
|
|
923
|
+
interface Window {
|
|
924
|
+
dotvvm: DotvvmGlobal;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
export default dotvvmExports;
|
|
928
|
+
}
|
|
929
|
+
type PostbackCommitFunction = () => Promise<DotvvmAfterPostBackEventArgs>;
|
|
930
|
+
type DotvvmPostbackHandler = {
|
|
931
|
+
execute(next: () => Promise<PostbackCommitFunction>, options: PostbackOptions): Promise<PostbackCommitFunction>;
|
|
932
|
+
name?: string;
|
|
933
|
+
after?: Array<string | DotvvmPostbackHandler>;
|
|
934
|
+
before?: Array<string | DotvvmPostbackHandler>;
|
|
935
|
+
};
|
|
936
|
+
type DotvvmPostbackErrorLike = {
|
|
937
|
+
readonly reason: DotvvmPostbackErrorReason;
|
|
938
|
+
};
|
|
939
|
+
type DotvvmPostbackErrorReason = ({
|
|
940
|
+
type: 'handler';
|
|
941
|
+
handlerName: string;
|
|
942
|
+
message?: string;
|
|
943
|
+
} | {
|
|
944
|
+
type: 'network';
|
|
945
|
+
err?: any;
|
|
946
|
+
} | {
|
|
947
|
+
type: 'gate';
|
|
948
|
+
} | {
|
|
949
|
+
type: 'commit';
|
|
950
|
+
args?: DotvvmErrorEventArgs;
|
|
951
|
+
} | {
|
|
952
|
+
type: 'csrfToken';
|
|
953
|
+
} | {
|
|
954
|
+
type: 'serverError';
|
|
955
|
+
status?: number;
|
|
956
|
+
responseObject: any;
|
|
957
|
+
response?: Response;
|
|
958
|
+
} | {
|
|
959
|
+
type: 'event';
|
|
960
|
+
} | {
|
|
961
|
+
type: 'validation';
|
|
962
|
+
responseObject: any;
|
|
963
|
+
response?: Response;
|
|
964
|
+
} | {
|
|
965
|
+
type: 'abort';
|
|
966
|
+
} | {
|
|
967
|
+
type: 'redirect';
|
|
968
|
+
responseObject: any;
|
|
969
|
+
response?: Response;
|
|
970
|
+
}) & {
|
|
971
|
+
options?: PostbackOptions;
|
|
972
|
+
};
|
|
973
|
+
type PostbackCommandType = "postback" | "staticCommand" | "spaNavigation";
|
|
974
|
+
type PostbackOptions = {
|
|
975
|
+
readonly postbackId: number;
|
|
976
|
+
readonly commandType: PostbackCommandType;
|
|
977
|
+
readonly args: any[];
|
|
978
|
+
readonly sender?: HTMLElement;
|
|
979
|
+
readonly viewModel?: any;
|
|
980
|
+
readonly knockoutContext?: KnockoutBindingContext;
|
|
981
|
+
serverResponseObject?: any;
|
|
982
|
+
validationTargetPath?: string;
|
|
983
|
+
abortSignal?: AbortSignal;
|
|
984
|
+
};
|
|
985
|
+
type DotvvmErrorEventArgs = PostbackOptions & {
|
|
986
|
+
readonly response?: Response;
|
|
987
|
+
readonly error: DotvvmPostbackErrorLike;
|
|
988
|
+
handled: boolean;
|
|
989
|
+
};
|
|
990
|
+
type DotvvmBeforePostBackEventArgs = PostbackOptions & {
|
|
991
|
+
cancel: boolean;
|
|
992
|
+
};
|
|
993
|
+
type DotvvmAfterPostBackEventArgs = PostbackOptions & {
|
|
994
|
+
/** Set to true in case the postback did not finish and it was cancelled by an event or a postback handler */
|
|
995
|
+
readonly wasInterrupted?: boolean;
|
|
996
|
+
readonly commandResult?: any;
|
|
997
|
+
readonly response?: Response;
|
|
998
|
+
readonly error?: DotvvmPostbackErrorLike;
|
|
999
|
+
};
|
|
1000
|
+
type DotvvmNavigationEventArgs = PostbackOptions & {
|
|
1001
|
+
readonly url: string;
|
|
1002
|
+
};
|
|
1003
|
+
type DotvvmSpaNavigatingEventArgs = DotvvmNavigationEventArgs & {
|
|
1004
|
+
cancel: boolean;
|
|
1005
|
+
};
|
|
1006
|
+
type DotvvmSpaNavigatedEventArgs = DotvvmNavigationEventArgs & {
|
|
1007
|
+
readonly response?: Response;
|
|
1008
|
+
};
|
|
1009
|
+
type DotvvmSpaNavigationFailedEventArgs = DotvvmNavigationEventArgs & {
|
|
1010
|
+
readonly response?: Response;
|
|
1011
|
+
readonly error?: DotvvmPostbackErrorLike;
|
|
1012
|
+
};
|
|
1013
|
+
type DotvvmRedirectEventArgs = DotvvmNavigationEventArgs & {
|
|
1014
|
+
readonly response?: Response;
|
|
1015
|
+
/** Whether the new url should replace the current url in the browsing history */
|
|
1016
|
+
readonly replace: boolean;
|
|
1017
|
+
};
|
|
1018
|
+
type DotvvmPostbackHandlersStartedEventArgs = PostbackOptions & {};
|
|
1019
|
+
type DotvvmPostbackHandlersCompletedEventArgs = PostbackOptions & {};
|
|
1020
|
+
type DotvvmPostbackResponseReceivedEventArgs = PostbackOptions & {
|
|
1021
|
+
readonly response: Response;
|
|
1022
|
+
};
|
|
1023
|
+
type DotvvmPostbackCommitInvokedEventArgs = PostbackOptions & {
|
|
1024
|
+
readonly response: Response;
|
|
1025
|
+
};
|
|
1026
|
+
type DotvvmPostbackViewModelUpdatedEventArgs = PostbackOptions & {
|
|
1027
|
+
readonly response: Response;
|
|
1028
|
+
};
|
|
1029
|
+
type DotvvmPostbackRejectedEventArgs = PostbackOptions & {
|
|
1030
|
+
readonly error: DotvvmPostbackErrorLike;
|
|
1031
|
+
};
|
|
1032
|
+
type DotvvmStaticCommandMethodEventArgs = PostbackOptions & {
|
|
1033
|
+
readonly methodId: string;
|
|
1034
|
+
readonly methodArgs: any[];
|
|
1035
|
+
};
|
|
1036
|
+
type DotvvmStaticCommandMethodInvokingEventArgs = DotvvmStaticCommandMethodEventArgs & {};
|
|
1037
|
+
type DotvvmStaticCommandMethodInvokedEventArgs = DotvvmStaticCommandMethodEventArgs & {
|
|
1038
|
+
readonly result: any;
|
|
1039
|
+
readonly response?: Response;
|
|
1040
|
+
};
|
|
1041
|
+
type DotvvmStaticCommandMethodFailedEventArgs = DotvvmStaticCommandMethodEventArgs & {
|
|
1042
|
+
readonly result?: any;
|
|
1043
|
+
readonly response?: Response;
|
|
1044
|
+
readonly error: DotvvmPostbackErrorLike;
|
|
1045
|
+
};
|
|
1046
|
+
type DotvvmInitEventArgs = {
|
|
1047
|
+
readonly viewModel: any;
|
|
1048
|
+
};
|
|
1049
|
+
type DotvvmInitCompletedEventArgs = {};
|
|
1050
|
+
interface DotvvmViewModelInfo {
|
|
1051
|
+
viewModel?: any;
|
|
1052
|
+
viewModelCacheId?: string;
|
|
1053
|
+
viewModelCache?: any;
|
|
1054
|
+
renderedResources?: string[];
|
|
1055
|
+
url?: string;
|
|
1056
|
+
virtualDirectory?: string;
|
|
1057
|
+
typeMetadata: TypeMap;
|
|
1058
|
+
}
|
|
1059
|
+
interface DotvvmViewModels {
|
|
1060
|
+
[name: string]: DotvvmViewModelInfo;
|
|
1061
|
+
root: DotvvmViewModelInfo;
|
|
1062
|
+
}
|
|
1063
|
+
interface DotvvmPostbackHandlerCollection {
|
|
1064
|
+
[name: string]: ((options: any) => DotvvmPostbackHandler);
|
|
1065
|
+
}
|
|
1066
|
+
type DotvvmStaticCommandResponse<T = any> = {
|
|
1067
|
+
result: any;
|
|
1068
|
+
customData: {
|
|
1069
|
+
[key: string]: any;
|
|
1070
|
+
};
|
|
1071
|
+
typeMetadata?: TypeMap;
|
|
1072
|
+
} | {
|
|
1073
|
+
action: "redirect";
|
|
1074
|
+
url: string;
|
|
1075
|
+
replace?: boolean;
|
|
1076
|
+
allowSpa?: boolean;
|
|
1077
|
+
};
|
|
1078
|
+
type DotvvmPostBackHandlerConfiguration = {
|
|
1079
|
+
name: string;
|
|
1080
|
+
options: (context: KnockoutBindingContext) => any;
|
|
1081
|
+
};
|
|
1082
|
+
type ClientFriendlyPostbackHandlerConfiguration = string | DotvvmPostbackHandler | DotvvmPostBackHandlerConfiguration | [string, object] | [string, (context: KnockoutBindingContext, data: any) => any];
|
|
1083
|
+
type PropertyValidationRuleInfo = {
|
|
1084
|
+
ruleName: string;
|
|
1085
|
+
errorMessage: string;
|
|
1086
|
+
parameters: any[];
|
|
1087
|
+
};
|
|
1088
|
+
type ValidationRuleTable = {
|
|
1089
|
+
[type: string]: {
|
|
1090
|
+
[property: string]: [PropertyValidationRuleInfo];
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
type StateUpdate<TViewModel> = (initial: DeepReadonly<TViewModel>) => DeepReadonly<TViewModel>;
|
|
1094
|
+
type UpdateDispatcher<TViewModel> = (update: StateUpdate<TViewModel>) => void;
|
|
1095
|
+
/** Knockout observable, including all child object and arrays */
|
|
1096
|
+
type DeepKnockoutObservable<T> = T extends (infer R)[] ? DeepKnockoutObservableArray<R> : T extends object ? KnockoutObservable<DeepKnockoutObservableObject<T>> : KnockoutObservable<T>;
|
|
1097
|
+
type DeepKnockoutObservableArray<T> = KnockoutObservableArray<DeepKnockoutObservable<T>>;
|
|
1098
|
+
type DeepKnockoutObservableObject<T> = {
|
|
1099
|
+
readonly [P in keyof T]: DeepKnockoutObservable<T[P]>;
|
|
1100
|
+
};
|
|
1101
|
+
/** Partial<T>, but including all child objects */
|
|
1102
|
+
type DeepPartial<T> = T extends object ? {
|
|
1103
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1104
|
+
} : T;
|
|
1105
|
+
/** Readonly<T>, but including all child objects and arrays */
|
|
1106
|
+
type DeepReadonly<T> = T extends TypeDefinition ? T : T extends (infer R)[] ? readonly DeepReadonly<R>[] : T extends object ? {
|
|
1107
|
+
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
1108
|
+
} : T;
|
|
1109
|
+
type DotvvmStateContainer<T> = {
|
|
1110
|
+
/** A property, returns latest state from dotvvm.state. It does not contain any knockout observable and does not have any propagation delay, as the value in the ko.observables */
|
|
1111
|
+
readonly state: DeepReadonly<T>;
|
|
1112
|
+
/** Sets new state directly into the dotvvm.state.
|
|
1113
|
+
* Note that the value arrives into the ko.observables asynchronously, so there might be slight delay */
|
|
1114
|
+
readonly setState: (newState: DeepReadonly<T>) => void;
|
|
1115
|
+
/** Patches the current state and sets it into dotvvm.state.
|
|
1116
|
+
* Compared to setState, when property does not exist in the patch parameter, the old value from state is used.
|
|
1117
|
+
* Note that the value arrives into the ko.observables asynchronously, so there might be slight delay
|
|
1118
|
+
* @example observable.patchState({ Prop2: 0 }) // Only must be specified, although Prop1 also exists and is required */
|
|
1119
|
+
readonly patchState: (patch: DeepReadonly<DeepPartial<T>>) => void;
|
|
1120
|
+
/** Dispatches update of the state.
|
|
1121
|
+
* Note that the value arrives into the ko.observables asynchronously, so there might be slight delay
|
|
1122
|
+
* @example observable.updateState(state => [ ...state, newElement ]) // This appends an element to an (observable) array
|
|
1123
|
+
* @example observable.updateState(state => state + 1) // Increments the value by one
|
|
1124
|
+
* @example observable.updateState(state => ({ ...state, MyProperty: state.MyProperty + 1 })) // Increments the property MyProperty by one
|
|
1125
|
+
*/
|
|
1126
|
+
readonly updateState: UpdateDispatcher<T>;
|
|
1127
|
+
};
|
|
1128
|
+
/** Knockout observable that is found in the DotVVM ViewModel - all nested objects and arrays are also observable + it has some helper functions (state, patchState, ...) */
|
|
1129
|
+
type DotvvmObservable<T> = DeepKnockoutObservable<T> & {
|
|
1130
|
+
/** @deprecated Use updateState instead */
|
|
1131
|
+
readonly updater: UpdateDispatcher<T>;
|
|
1132
|
+
} & DotvvmStateContainer<T>;
|
|
1133
|
+
type RootViewModel = {
|
|
1134
|
+
$type: string;
|
|
1135
|
+
$csrfToken?: string;
|
|
1136
|
+
[name: string]: any;
|
|
1137
|
+
};
|
|
1138
|
+
type TypeMap = {
|
|
1139
|
+
[typeId: string]: TypeMetadata;
|
|
1140
|
+
};
|
|
1141
|
+
type DynamicTypeMetadata = {
|
|
1142
|
+
debugName?: string;
|
|
1143
|
+
type: "dynamic";
|
|
1144
|
+
};
|
|
1145
|
+
type ObjectTypeMetadata = {
|
|
1146
|
+
type: "object";
|
|
1147
|
+
debugName?: string;
|
|
1148
|
+
properties: {
|
|
1149
|
+
[prop: string]: PropertyMetadata;
|
|
1150
|
+
};
|
|
1151
|
+
};
|
|
1152
|
+
type EnumTypeMetadata = {
|
|
1153
|
+
type: "enum";
|
|
1154
|
+
debugName?: string;
|
|
1155
|
+
values: {
|
|
1156
|
+
[name: string]: number;
|
|
1157
|
+
};
|
|
1158
|
+
isFlags?: boolean;
|
|
1159
|
+
};
|
|
1160
|
+
type TypeMetadata = ObjectTypeMetadata | EnumTypeMetadata | DynamicTypeMetadata;
|
|
1161
|
+
type PropertyMetadata = {
|
|
1162
|
+
type: TypeDefinition;
|
|
1163
|
+
post?: "always" | "pathOnly" | "no";
|
|
1164
|
+
update?: "always" | "no";
|
|
1165
|
+
validationRules?: PropertyValidationRuleInfo[];
|
|
1166
|
+
clientExtenders?: ClientExtenderInfo[];
|
|
1167
|
+
};
|
|
1168
|
+
type TypeDefinition = string | {
|
|
1169
|
+
readonly type: "nullable";
|
|
1170
|
+
readonly inner: TypeDefinition;
|
|
1171
|
+
} | {
|
|
1172
|
+
readonly type: "dynamic";
|
|
1173
|
+
} | TypeDefinition[];
|
|
1174
|
+
type ClientExtenderInfo = {
|
|
1175
|
+
name: string;
|
|
1176
|
+
parameter: any;
|
|
1177
|
+
};
|
|
1178
|
+
type CoerceErrorType = {
|
|
1179
|
+
isError: true;
|
|
1180
|
+
wasCoerced: false;
|
|
1181
|
+
message: string;
|
|
1182
|
+
path: string;
|
|
1183
|
+
prependPathFragment(fragment: string): void;
|
|
1184
|
+
value: never;
|
|
1185
|
+
};
|
|
1186
|
+
type CoerceResult = CoerceErrorType | {
|
|
1187
|
+
value: any;
|
|
1188
|
+
wasCoerced?: boolean;
|
|
1189
|
+
isError?: false;
|
|
1190
|
+
};
|
|
1191
|
+
type DotvvmFileUploadCollection = {
|
|
1192
|
+
Files: KnockoutObservableArray<KnockoutObservable<DotvvmFileUploadData>>;
|
|
1193
|
+
Progress: KnockoutObservable<number>;
|
|
1194
|
+
Error: KnockoutObservable<string>;
|
|
1195
|
+
IsBusy: KnockoutObservable<boolean>;
|
|
1196
|
+
};
|
|
1197
|
+
type DotvvmFileUploadData = {
|
|
1198
|
+
FileId: KnockoutObservable<string>;
|
|
1199
|
+
FileName: KnockoutObservable<string>;
|
|
1200
|
+
FileSize: KnockoutObservable<DotvvmFileSize>;
|
|
1201
|
+
IsFileTypeAllowed: KnockoutObservable<boolean>;
|
|
1202
|
+
IsMaxSizeExceeded: KnockoutObservable<boolean>;
|
|
1203
|
+
IsAllowed: KnockoutObservable<boolean>;
|
|
1204
|
+
};
|
|
1205
|
+
type DotvvmFileSize = {
|
|
1206
|
+
Bytes: KnockoutObservable<number>;
|
|
1207
|
+
FormattedText: KnockoutObservable<string>;
|
|
1208
|
+
};
|
|
1209
|
+
type DotvvmJsComponent = {
|
|
1210
|
+
updateProps(p: {
|
|
1211
|
+
[key: string]: any;
|
|
1212
|
+
}): void;
|
|
1213
|
+
dispose(): void;
|
|
1214
|
+
};
|
|
1215
|
+
type DotvvmJsComponentFactory = {
|
|
1216
|
+
create(element: HTMLElement, props: {
|
|
1217
|
+
[key: string]: any;
|
|
1218
|
+
}, commands: {
|
|
1219
|
+
[key: string]: (args: any[]) => Promise<any>;
|
|
1220
|
+
}, templates: {
|
|
1221
|
+
[key: string]: string;
|
|
1222
|
+
}, // TODO
|
|
1223
|
+
setProps: (p: {
|
|
1224
|
+
[key: string]: any;
|
|
1225
|
+
}) => void): DotvvmJsComponent;
|
|
1226
|
+
};
|
|
1227
|
+
type DotvvmViewModuleCommandName = `${'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'}${string}`;
|
|
1228
|
+
type DotvvmViewModule = {
|
|
1229
|
+
$controls?: {
|
|
1230
|
+
[name: string]: DotvvmJsComponentFactory;
|
|
1231
|
+
};
|
|
1232
|
+
$dispose?: (context: any) => void;
|
|
1233
|
+
[commandName: DotvvmViewModuleCommandName]: (...args: any[]) => Promise<any> | any;
|
|
1234
|
+
};
|
|
1235
|
+
type DotvvmModuleContext<TViewModelType = any> = {
|
|
1236
|
+
/** Name of the resource defining the view module */
|
|
1237
|
+
moduleName: string;
|
|
1238
|
+
/** Instance of the view module */
|
|
1239
|
+
module: any;
|
|
1240
|
+
/** List of element where this module is mounted. It will be `document.body` for pages and the wrapper tag for markup controls. Most likely, only one element is in the collection. */
|
|
1241
|
+
elements: HTMLElement[];
|
|
1242
|
+
/** Properties of the markup control which were sent to the client */
|
|
1243
|
+
properties: {
|
|
1244
|
+
[name: string]: DotvvmObservable<any>;
|
|
1245
|
+
};
|
|
1246
|
+
/** <dot:NamedCommand /> declared in the dothtml/dotcontrol view. */
|
|
1247
|
+
namedCommands: {
|
|
1248
|
+
[name: string]: (...args: any[]) => Promise<any>;
|
|
1249
|
+
};
|
|
1250
|
+
} & DotvvmStateContainer<TViewModelType>;
|