@types/knockout 3.4.72 → 3.4.74
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.
- knockout/LICENSE +0 -0
- knockout/README.md +2 -3
- knockout/index.d.ts +201 -84
- knockout/package.json +22 -22
knockout/LICENSE
CHANGED
|
File without changes
|
knockout/README.md
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
> `npm install --save @types/knockout`
|
|
3
3
|
|
|
4
4
|
# Summary
|
|
5
|
-
This package contains type definitions for
|
|
5
|
+
This package contains type definitions for knockout (http://knockoutjs.com).
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knockout.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 18 Oct 2023 05:47:07 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
|
-
* Global values: `ko`
|
|
14
13
|
|
|
15
14
|
# Credits
|
|
16
15
|
These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Igor Oleinikov](https://github.com/Igorbek), [Clément Bourgeois](https://github.com/moonpyk), [Matt Brooks](https://github.com/EnableSoftware), [Benjamin Eckardt](https://github.com/BenjaminEckardt), [Mathias Lorenzen](https://github.com/ffMathy), [Leonardo Lombardi](https://github.com/ltlombardi), [Retsam](https://github.com/Retsam), and [Rey Pena](https://github.com/ReyPena).
|
knockout/index.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
// Type definitions for Knockout v3.4.0
|
|
2
|
-
// Project: http://knockoutjs.com
|
|
3
|
-
// Definitions by: Boris Yankov <https://github.com/borisyankov>,
|
|
4
|
-
// Igor Oleinikov <https://github.com/Igorbek>,
|
|
5
|
-
// Clément Bourgeois <https://github.com/moonpyk>,
|
|
6
|
-
// Matt Brooks <https://github.com/EnableSoftware>,
|
|
7
|
-
// Benjamin Eckardt <https://github.com/BenjaminEckardt>,
|
|
8
|
-
// Mathias Lorenzen <https://github.com/ffMathy>,
|
|
9
|
-
// Leonardo Lombardi <https://github.com/ltlombardi>
|
|
10
|
-
// Retsam <https://github.com/Retsam>
|
|
11
|
-
// Rey Pena <https://github.com/ReyPena>
|
|
12
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
13
|
-
|
|
14
1
|
interface KnockoutSubscribableFunctions<T> {
|
|
15
2
|
/**
|
|
16
3
|
* Notify subscribers of knockout "change" event. This doesn't actually change the observable value.
|
|
@@ -42,16 +29,16 @@ interface KnockoutObservableFunctions<T> {
|
|
|
42
29
|
// The functions of observable arrays that don't mutate the array
|
|
43
30
|
interface KnockoutReadonlyObservableArrayFunctions<T> {
|
|
44
31
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
* Returns the index of the first occurrence of a value in an array.
|
|
33
|
+
* @param searchElement The value to locate in the array.
|
|
34
|
+
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
|
|
35
|
+
*/
|
|
49
36
|
indexOf(searchElement: T, fromIndex?: number): number;
|
|
50
37
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
* Returns a section of an array.
|
|
39
|
+
* @param start The beginning of the specified portion of the array.
|
|
40
|
+
* @param end The end of the specified portion of the array.
|
|
41
|
+
*/
|
|
55
42
|
slice(start: number, end?: number): T[];
|
|
56
43
|
}
|
|
57
44
|
// The functions of observable arrays that mutate the array
|
|
@@ -152,7 +139,7 @@ interface KnockoutObservableArrayFunctions<T> extends KnockoutReadonlyObservable
|
|
|
152
139
|
interface KnockoutSubscribableStatic {
|
|
153
140
|
fn: KnockoutSubscribableFunctions<any>;
|
|
154
141
|
|
|
155
|
-
new
|
|
142
|
+
new<T>(): KnockoutSubscribable<T>;
|
|
156
143
|
}
|
|
157
144
|
|
|
158
145
|
interface KnockoutSubscription {
|
|
@@ -188,10 +175,10 @@ interface KnockoutSubscribable<T> extends KnockoutSubscribableFunctions<T> {
|
|
|
188
175
|
* Customizes observables basic functionality.
|
|
189
176
|
* @param requestedExtenders Name of the extender feature and its value, e.g. { notify: 'always' }, { rateLimit: 50 }
|
|
190
177
|
*/
|
|
191
|
-
extend(requestedExtenders: { [key: string]: any
|
|
178
|
+
extend(requestedExtenders: { [key: string]: any }): KnockoutSubscribable<T>;
|
|
192
179
|
/**
|
|
193
|
-
|
|
194
|
-
|
|
180
|
+
* Gets total number of subscribers.
|
|
181
|
+
*/
|
|
195
182
|
getSubscriptionsCount(): number;
|
|
196
183
|
/**
|
|
197
184
|
* Gets number of subscribers of a particular event.
|
|
@@ -246,7 +233,7 @@ interface KnockoutComputed<T> extends KnockoutReadonlyComputed<T>, KnockoutObser
|
|
|
246
233
|
* Customizes observables basic functionality.
|
|
247
234
|
* @param requestedExtenders Name of the extender feature and it's value, e.g. { notify: 'always' }, { rateLimit: 50 }
|
|
248
235
|
*/
|
|
249
|
-
extend(requestedExtenders: { [key: string]: any
|
|
236
|
+
extend(requestedExtenders: { [key: string]: any }): KnockoutComputed<T>;
|
|
250
237
|
}
|
|
251
238
|
|
|
252
239
|
interface KnockoutObservableArrayStatic {
|
|
@@ -259,9 +246,15 @@ interface KnockoutObservableArrayStatic {
|
|
|
259
246
|
* While all observable arrays are writable at runtime, this type is analogous to the native ReadonlyArray type:
|
|
260
247
|
* casting an observable array to this type expresses the intention that it shouldn't be mutated.
|
|
261
248
|
*/
|
|
262
|
-
interface KnockoutReadonlyObservableArray<T>
|
|
249
|
+
interface KnockoutReadonlyObservableArray<T>
|
|
250
|
+
extends KnockoutReadonlyObservable<ReadonlyArray<T>>, KnockoutReadonlyObservableArrayFunctions<T>
|
|
251
|
+
{
|
|
263
252
|
// NOTE: Keep in sync with KnockoutObservableArray<T>, see note on KnockoutObservableArray<T>
|
|
264
|
-
subscribe(
|
|
253
|
+
subscribe(
|
|
254
|
+
callback: (newValue: KnockoutArrayChange<T>[]) => void,
|
|
255
|
+
target: any,
|
|
256
|
+
event: "arrayChange",
|
|
257
|
+
): KnockoutSubscription;
|
|
265
258
|
subscribe(callback: (newValue: T[]) => void, target: any, event: "beforeChange"): KnockoutSubscription;
|
|
266
259
|
subscribe(callback: (newValue: T[]) => void, target?: any, event?: "change"): KnockoutSubscription;
|
|
267
260
|
subscribe<U>(callback: (newValue: U) => void, target: any, event: string): KnockoutSubscription;
|
|
@@ -273,12 +266,16 @@ interface KnockoutReadonlyObservableArray<T> extends KnockoutReadonlyObservable<
|
|
|
273
266
|
So it extends KnockoutObservable<T[]> and duplicates the subscribe definitions, which should be kept in sync
|
|
274
267
|
*/
|
|
275
268
|
interface KnockoutObservableArray<T> extends KnockoutObservable<T[]>, KnockoutObservableArrayFunctions<T> {
|
|
276
|
-
subscribe(
|
|
269
|
+
subscribe(
|
|
270
|
+
callback: (newValue: KnockoutArrayChange<T>[]) => void,
|
|
271
|
+
target: any,
|
|
272
|
+
event: "arrayChange",
|
|
273
|
+
): KnockoutSubscription;
|
|
277
274
|
subscribe(callback: (newValue: T[]) => void, target: any, event: "beforeChange"): KnockoutSubscription;
|
|
278
275
|
subscribe(callback: (newValue: T[]) => void, target?: any, event?: "change"): KnockoutSubscription;
|
|
279
276
|
subscribe<U>(callback: (newValue: U) => void, target: any, event: string): KnockoutSubscription;
|
|
280
277
|
|
|
281
|
-
extend(requestedExtenders: { [key: string]: any
|
|
278
|
+
extend(requestedExtenders: { [key: string]: any }): KnockoutObservableArray<T>;
|
|
282
279
|
}
|
|
283
280
|
|
|
284
281
|
interface KnockoutObservableStatic {
|
|
@@ -286,8 +283,8 @@ interface KnockoutObservableStatic {
|
|
|
286
283
|
|
|
287
284
|
<T>(value: T): KnockoutObservable<T>;
|
|
288
285
|
<T>(value: any): KnockoutObservable<T>;
|
|
289
|
-
<T = any>(value: null): KnockoutObservable<T | null
|
|
290
|
-
<T = any>(): KnockoutObservable<T | undefined
|
|
286
|
+
<T = any>(value: null): KnockoutObservable<T | null>;
|
|
287
|
+
<T = any>(): KnockoutObservable<T | undefined>;
|
|
291
288
|
}
|
|
292
289
|
|
|
293
290
|
/**
|
|
@@ -301,8 +298,8 @@ interface KnockoutReadonlyObservable<T> extends KnockoutSubscribable<T>, Knockou
|
|
|
301
298
|
* Returns the current value of the computed observable without creating a dependency.
|
|
302
299
|
*/
|
|
303
300
|
peek(): T;
|
|
304
|
-
valueHasMutated?: { (): void
|
|
305
|
-
valueWillMutate?: { (): void
|
|
301
|
+
valueHasMutated?: { (): void } | undefined;
|
|
302
|
+
valueWillMutate?: { (): void } | undefined;
|
|
306
303
|
}
|
|
307
304
|
|
|
308
305
|
interface KnockoutObservable<T> extends KnockoutReadonlyObservable<T> {
|
|
@@ -313,7 +310,7 @@ interface KnockoutObservable<T> extends KnockoutReadonlyObservable<T> {
|
|
|
313
310
|
* Customizes observables basic functionality.
|
|
314
311
|
* @param requestedExtenders Name of the extender feature and it's value, e.g. { notify: 'always' }, { rateLimit: 50 }
|
|
315
312
|
*/
|
|
316
|
-
extend(requestedExtenders: { [key: string]: any
|
|
313
|
+
extend(requestedExtenders: { [key: string]: any }): KnockoutObservable<T>;
|
|
317
314
|
}
|
|
318
315
|
|
|
319
316
|
interface KnockoutComputedOptions<T> {
|
|
@@ -370,15 +367,20 @@ interface KnockoutBindingContext {
|
|
|
370
367
|
* Clones the current Binding Context, adding extra properties to it.
|
|
371
368
|
* @param properties object with properties to be added in the binding context.
|
|
372
369
|
*/
|
|
373
|
-
extend(properties: { [key: string]: any
|
|
370
|
+
extend(properties: { [key: string]: any } | (() => { [key: string]: any })): KnockoutBindingContext;
|
|
374
371
|
/**
|
|
375
|
-
* This returns a new binding context whose viewmodel is the first parameter and whose $parentContext is the current bindingContext.
|
|
372
|
+
* This returns a new binding context whose viewmodel is the first parameter and whose $parentContext is the current bindingContext.
|
|
376
373
|
* @param dataItemOrAccessor The binding context of the children.
|
|
377
374
|
* @param dataItemAlias An alias for the data item in descendant contexts.
|
|
378
375
|
* @param extendCallback Function to be called.
|
|
379
376
|
* @param options Further options.
|
|
380
377
|
*/
|
|
381
|
-
createChildContext(
|
|
378
|
+
createChildContext(
|
|
379
|
+
dataItemOrAccessor: any,
|
|
380
|
+
dataItemAlias?: string,
|
|
381
|
+
extendCallback?: Function,
|
|
382
|
+
options?: { "exportDependencies": boolean },
|
|
383
|
+
): any;
|
|
382
384
|
}
|
|
383
385
|
|
|
384
386
|
interface KnockoutAllBindingsAccessor {
|
|
@@ -389,10 +391,28 @@ interface KnockoutAllBindingsAccessor {
|
|
|
389
391
|
|
|
390
392
|
interface KnockoutBindingHandler<E extends Node = any, V = any, VM = any> {
|
|
391
393
|
after?: Array<string> | undefined;
|
|
392
|
-
init?:
|
|
393
|
-
|
|
394
|
+
init?:
|
|
395
|
+
| ((
|
|
396
|
+
element: E,
|
|
397
|
+
valueAccessor: () => V,
|
|
398
|
+
allBindingsAccessor: KnockoutAllBindingsAccessor,
|
|
399
|
+
viewModel: VM,
|
|
400
|
+
bindingContext: KnockoutBindingContext,
|
|
401
|
+
) => void | { controlsDescendantBindings: boolean })
|
|
402
|
+
| undefined;
|
|
403
|
+
update?:
|
|
404
|
+
| ((
|
|
405
|
+
element: E,
|
|
406
|
+
valueAccessor: () => V,
|
|
407
|
+
allBindingsAccessor: KnockoutAllBindingsAccessor,
|
|
408
|
+
viewModel: VM,
|
|
409
|
+
bindingContext: KnockoutBindingContext,
|
|
410
|
+
) => void)
|
|
411
|
+
| undefined;
|
|
394
412
|
options?: any;
|
|
395
|
-
preprocess?:
|
|
413
|
+
preprocess?:
|
|
414
|
+
| ((value: string, name: string, addBindingCallback?: (name: string, value: string) => void) => string)
|
|
415
|
+
| undefined;
|
|
396
416
|
[s: string]: any;
|
|
397
417
|
}
|
|
398
418
|
|
|
@@ -441,16 +461,16 @@ interface KnockoutMemoization {
|
|
|
441
461
|
parseMemoText(memoText: string): string;
|
|
442
462
|
}
|
|
443
463
|
|
|
444
|
-
interface KnockoutVirtualElement {
|
|
464
|
+
interface KnockoutVirtualElement {}
|
|
445
465
|
|
|
446
466
|
interface KnockoutVirtualElements {
|
|
447
|
-
allowedBindings: { [bindingName: string]: boolean
|
|
467
|
+
allowedBindings: { [bindingName: string]: boolean };
|
|
448
468
|
emptyNode(node: KnockoutVirtualElement): void;
|
|
449
469
|
firstChild(node: KnockoutVirtualElement): KnockoutVirtualElement;
|
|
450
470
|
insertAfter(container: KnockoutVirtualElement, nodeToInsert: Node, insertAfter: Node): void;
|
|
451
471
|
nextSibling(node: KnockoutVirtualElement): Node;
|
|
452
472
|
prepend(node: KnockoutVirtualElement, toInsert: Node): void;
|
|
453
|
-
setDomNodeChildren(node: KnockoutVirtualElement, newChildren: { length: number;[index: number]: Node
|
|
473
|
+
setDomNodeChildren(node: KnockoutVirtualElement, newChildren: { length: number; [index: number]: Node }): void;
|
|
454
474
|
childNodes(node: KnockoutVirtualElement): Node[];
|
|
455
475
|
}
|
|
456
476
|
|
|
@@ -459,7 +479,7 @@ interface KnockoutExtenders {
|
|
|
459
479
|
notify(target: any, notifyWhen: string): any;
|
|
460
480
|
|
|
461
481
|
rateLimit(target: any, timeout: number): any;
|
|
462
|
-
rateLimit(target: any, options: { timeout: number; method?: string | undefined
|
|
482
|
+
rateLimit(target: any, options: { timeout: number; method?: string | undefined }): any;
|
|
463
483
|
|
|
464
484
|
trackArrayChanges(target: any): any;
|
|
465
485
|
}
|
|
@@ -597,10 +617,9 @@ interface KnockoutTemplateAnonymous extends KnockoutTemplateSourcesDomElement {
|
|
|
597
617
|
}
|
|
598
618
|
|
|
599
619
|
interface KnockoutTemplateSources {
|
|
600
|
-
|
|
601
620
|
domElement: {
|
|
602
|
-
prototype: KnockoutTemplateSourcesDomElement
|
|
603
|
-
new(element: Element): KnockoutTemplateSourcesDomElement
|
|
621
|
+
prototype: KnockoutTemplateSourcesDomElement;
|
|
622
|
+
new(element: Element): KnockoutTemplateSourcesDomElement;
|
|
604
623
|
};
|
|
605
624
|
|
|
606
625
|
anonymousTemplate: {
|
|
@@ -614,7 +633,6 @@ interface KnockoutTemplateSources {
|
|
|
614
633
|
//////////////////////////////////
|
|
615
634
|
|
|
616
635
|
interface KnockoutNativeTemplateEngine extends KnockoutTemplateEngine {
|
|
617
|
-
|
|
618
636
|
renderTemplateSource(templateSource: Object, bindingContext?: KnockoutBindingContext, options?: Object): any[];
|
|
619
637
|
}
|
|
620
638
|
|
|
@@ -623,12 +641,16 @@ interface KnockoutNativeTemplateEngine extends KnockoutTemplateEngine {
|
|
|
623
641
|
//////////////////////////////////
|
|
624
642
|
|
|
625
643
|
interface KnockoutTemplateEngine {
|
|
626
|
-
|
|
627
644
|
createJavaScriptEvaluatorBlock(script: string): string;
|
|
628
645
|
|
|
629
646
|
makeTemplateSource(template: any, templateDocument?: Document): any;
|
|
630
647
|
|
|
631
|
-
renderTemplate(
|
|
648
|
+
renderTemplate(
|
|
649
|
+
template: any,
|
|
650
|
+
bindingContext: KnockoutBindingContext,
|
|
651
|
+
options: Object,
|
|
652
|
+
templateDocument: Document,
|
|
653
|
+
): any;
|
|
632
654
|
|
|
633
655
|
isTemplateRewritten(template: any, templateDocument: Document): boolean;
|
|
634
656
|
|
|
@@ -659,9 +681,17 @@ interface KnockoutStatic {
|
|
|
659
681
|
|
|
660
682
|
applyBindings(viewModelOrBindingContext?: any, rootNode?: any): void;
|
|
661
683
|
applyBindingsToDescendants(viewModelOrBindingContext: any, rootNode: any): void;
|
|
662
|
-
applyBindingAccessorsToNode(
|
|
684
|
+
applyBindingAccessorsToNode(
|
|
685
|
+
node: Node,
|
|
686
|
+
bindings: (bindingContext: KnockoutBindingContext, node: Node) => {},
|
|
687
|
+
bindingContext: KnockoutBindingContext,
|
|
688
|
+
): void;
|
|
663
689
|
applyBindingAccessorsToNode(node: Node, bindings: {}, bindingContext: KnockoutBindingContext): void;
|
|
664
|
-
applyBindingAccessorsToNode(
|
|
690
|
+
applyBindingAccessorsToNode(
|
|
691
|
+
node: Node,
|
|
692
|
+
bindings: (bindingContext: KnockoutBindingContext, node: Node) => {},
|
|
693
|
+
viewModel: any,
|
|
694
|
+
): void;
|
|
665
695
|
applyBindingAccessorsToNode(node: Node, bindings: {}, viewModel: any): void;
|
|
666
696
|
applyBindingsToNode(node: Node, bindings: any, viewModelOrBindingContext?: any): any;
|
|
667
697
|
|
|
@@ -781,7 +811,6 @@ interface KnockoutStatic {
|
|
|
781
811
|
//////////////////////////////////
|
|
782
812
|
|
|
783
813
|
templateEngine: {
|
|
784
|
-
|
|
785
814
|
prototype: KnockoutTemplateEngine;
|
|
786
815
|
|
|
787
816
|
new(): KnockoutTemplateEngine;
|
|
@@ -792,9 +821,16 @@ interface KnockoutStatic {
|
|
|
792
821
|
//////////////////////////////////
|
|
793
822
|
|
|
794
823
|
templateRewriting: {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
824
|
+
ensureTemplateIsRewritten(
|
|
825
|
+
template: Node,
|
|
826
|
+
templateEngine: KnockoutTemplateEngine,
|
|
827
|
+
templateDocument: Document,
|
|
828
|
+
): any;
|
|
829
|
+
ensureTemplateIsRewritten(
|
|
830
|
+
template: string,
|
|
831
|
+
templateEngine: KnockoutTemplateEngine,
|
|
832
|
+
templateDocument: Document,
|
|
833
|
+
): any;
|
|
798
834
|
|
|
799
835
|
memoizeBindingAttributeSyntax(htmlString: string, templateEngine: KnockoutTemplateEngine): any;
|
|
800
836
|
|
|
@@ -806,7 +842,6 @@ interface KnockoutStatic {
|
|
|
806
842
|
//////////////////////////////////
|
|
807
843
|
|
|
808
844
|
nativeTemplateEngine: {
|
|
809
|
-
|
|
810
845
|
prototype: KnockoutNativeTemplateEngine;
|
|
811
846
|
|
|
812
847
|
new(): KnockoutNativeTemplateEngine;
|
|
@@ -819,7 +854,6 @@ interface KnockoutStatic {
|
|
|
819
854
|
//////////////////////////////////
|
|
820
855
|
|
|
821
856
|
jqueryTmplTemplateEngine: {
|
|
822
|
-
|
|
823
857
|
prototype: KnockoutTemplateEngine;
|
|
824
858
|
|
|
825
859
|
renderTemplateSource(templateSource: Object, bindingContext: KnockoutBindingContext, options: Object): Node[];
|
|
@@ -835,19 +869,91 @@ interface KnockoutStatic {
|
|
|
835
869
|
|
|
836
870
|
setTemplateEngine(templateEngine: KnockoutNativeTemplateEngine | undefined): void;
|
|
837
871
|
|
|
838
|
-
renderTemplate(
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
renderTemplate(
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
872
|
+
renderTemplate(
|
|
873
|
+
template: Function,
|
|
874
|
+
dataOrBindingContext: KnockoutBindingContext,
|
|
875
|
+
options: Object,
|
|
876
|
+
targetNodeOrNodeArray: Node,
|
|
877
|
+
renderMode: string,
|
|
878
|
+
): any;
|
|
879
|
+
renderTemplate(
|
|
880
|
+
template: any,
|
|
881
|
+
dataOrBindingContext: KnockoutBindingContext,
|
|
882
|
+
options: Object,
|
|
883
|
+
targetNodeOrNodeArray: Node,
|
|
884
|
+
renderMode: string,
|
|
885
|
+
): any;
|
|
886
|
+
renderTemplate(
|
|
887
|
+
template: Function,
|
|
888
|
+
dataOrBindingContext: any,
|
|
889
|
+
options: Object,
|
|
890
|
+
targetNodeOrNodeArray: Node,
|
|
891
|
+
renderMode: string,
|
|
892
|
+
): any;
|
|
893
|
+
renderTemplate(
|
|
894
|
+
template: any,
|
|
895
|
+
dataOrBindingContext: any,
|
|
896
|
+
options: Object,
|
|
897
|
+
targetNodeOrNodeArray: Node,
|
|
898
|
+
renderMode: string,
|
|
899
|
+
): any;
|
|
900
|
+
renderTemplate(
|
|
901
|
+
template: Function,
|
|
902
|
+
dataOrBindingContext: KnockoutBindingContext,
|
|
903
|
+
options: Object,
|
|
904
|
+
targetNodeOrNodeArray: Node[],
|
|
905
|
+
renderMode: string,
|
|
906
|
+
): any;
|
|
907
|
+
renderTemplate(
|
|
908
|
+
template: any,
|
|
909
|
+
dataOrBindingContext: KnockoutBindingContext,
|
|
910
|
+
options: Object,
|
|
911
|
+
targetNodeOrNodeArray: Node[],
|
|
912
|
+
renderMode: string,
|
|
913
|
+
): any;
|
|
914
|
+
renderTemplate(
|
|
915
|
+
template: Function,
|
|
916
|
+
dataOrBindingContext: any,
|
|
917
|
+
options: Object,
|
|
918
|
+
targetNodeOrNodeArray: Node[],
|
|
919
|
+
renderMode: string,
|
|
920
|
+
): any;
|
|
921
|
+
renderTemplate(
|
|
922
|
+
template: any,
|
|
923
|
+
dataOrBindingContext: any,
|
|
924
|
+
options: Object,
|
|
925
|
+
targetNodeOrNodeArray: Node[],
|
|
926
|
+
renderMode: string,
|
|
927
|
+
): any;
|
|
928
|
+
|
|
929
|
+
renderTemplateForEach(
|
|
930
|
+
template: Function,
|
|
931
|
+
arrayOrObservableArray: any[],
|
|
932
|
+
options: Object,
|
|
933
|
+
targetNode: Node,
|
|
934
|
+
parentBindingContext: KnockoutBindingContext,
|
|
935
|
+
): any;
|
|
936
|
+
renderTemplateForEach(
|
|
937
|
+
template: any,
|
|
938
|
+
arrayOrObservableArray: any[],
|
|
939
|
+
options: Object,
|
|
940
|
+
targetNode: Node,
|
|
941
|
+
parentBindingContext: KnockoutBindingContext,
|
|
942
|
+
): any;
|
|
943
|
+
renderTemplateForEach(
|
|
944
|
+
template: Function,
|
|
945
|
+
arrayOrObservableArray: KnockoutObservable<any>,
|
|
946
|
+
options: Object,
|
|
947
|
+
targetNode: Node,
|
|
948
|
+
parentBindingContext: KnockoutBindingContext,
|
|
949
|
+
): any;
|
|
950
|
+
renderTemplateForEach(
|
|
951
|
+
template: any,
|
|
952
|
+
arrayOrObservableArray: KnockoutObservable<any>,
|
|
953
|
+
options: Object,
|
|
954
|
+
targetNode: Node,
|
|
955
|
+
parentBindingContext: KnockoutBindingContext,
|
|
956
|
+
): any;
|
|
851
957
|
|
|
852
958
|
/**
|
|
853
959
|
* Executes a callback function inside a computed observable, without creating a dependecy between it and the observables inside the function.
|
|
@@ -877,7 +983,13 @@ interface KnockoutStatic {
|
|
|
877
983
|
Note that if you need to write to the viewModel without an observable property,
|
|
878
984
|
you need to set ko.expressionRewriting.twoWayBindings[key] = true; *before* the binding evaluation.
|
|
879
985
|
*/
|
|
880
|
-
writeValueToProperty: (
|
|
986
|
+
writeValueToProperty: (
|
|
987
|
+
property: KnockoutObservable<any> | any,
|
|
988
|
+
allBindings: KnockoutAllBindingsAccessor,
|
|
989
|
+
key: string,
|
|
990
|
+
value: any,
|
|
991
|
+
checkIfDifferent?: boolean,
|
|
992
|
+
) => void;
|
|
881
993
|
};
|
|
882
994
|
|
|
883
995
|
/////////////////////////////////
|
|
@@ -885,14 +997,13 @@ interface KnockoutStatic {
|
|
|
885
997
|
bindingProvider: {
|
|
886
998
|
instance: KnockoutBindingProvider;
|
|
887
999
|
new(): KnockoutBindingProvider;
|
|
888
|
-
}
|
|
1000
|
+
};
|
|
889
1001
|
|
|
890
1002
|
/////////////////////////////////
|
|
891
1003
|
// selectExtensions.js
|
|
892
1004
|
/////////////////////////////////
|
|
893
1005
|
|
|
894
1006
|
selectExtensions: {
|
|
895
|
-
|
|
896
1007
|
readValue(element: HTMLElement): any;
|
|
897
1008
|
|
|
898
1009
|
writeValue(element: HTMLElement, value: any, allowUnset?: boolean): void;
|
|
@@ -905,9 +1016,9 @@ interface KnockoutStatic {
|
|
|
905
1016
|
/////////////////////////////////
|
|
906
1017
|
|
|
907
1018
|
options: {
|
|
908
|
-
deferUpdates: boolean
|
|
1019
|
+
deferUpdates: boolean;
|
|
909
1020
|
|
|
910
|
-
useOnlyNativeEvents: boolean
|
|
1021
|
+
useOnlyNativeEvents: boolean;
|
|
911
1022
|
};
|
|
912
1023
|
|
|
913
1024
|
/////////////////////////////////
|
|
@@ -926,7 +1037,7 @@ interface KnockoutStatic {
|
|
|
926
1037
|
interface KnockoutBindingProvider {
|
|
927
1038
|
nodeHasBindings(node: Node): boolean;
|
|
928
1039
|
getBindings(node: Node, bindingContext: KnockoutBindingContext): {};
|
|
929
|
-
getBindingAccessors?(node: Node, bindingContext: KnockoutBindingContext): { [key: string]: string
|
|
1040
|
+
getBindingAccessors?(node: Node, bindingContext: KnockoutBindingContext): { [key: string]: string };
|
|
930
1041
|
}
|
|
931
1042
|
|
|
932
1043
|
interface KnockoutComputedContext {
|
|
@@ -948,7 +1059,7 @@ interface KnockoutComputedContext {
|
|
|
948
1059
|
//
|
|
949
1060
|
declare namespace KnockoutComponentTypes {
|
|
950
1061
|
type ViewModel = ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule;
|
|
951
|
-
|
|
1062
|
+
|
|
952
1063
|
interface Config<T> {
|
|
953
1064
|
viewModel?: T | undefined;
|
|
954
1065
|
template: string | Node[] | DocumentFragment | TemplateElement | AMDModule;
|
|
@@ -1001,7 +1112,11 @@ declare namespace KnockoutComponentTypes {
|
|
|
1001
1112
|
* Define this if: you want to take control over how component configurations are interpreted, e.g., if you do not want to use the standard 'viewModel/template' pair format.
|
|
1002
1113
|
* @see {@link https://knockoutjs.com/documentation/component-loaders.html}
|
|
1003
1114
|
*/
|
|
1004
|
-
loadComponent?(
|
|
1115
|
+
loadComponent?(
|
|
1116
|
+
componentName: string,
|
|
1117
|
+
config: ComponentConfig,
|
|
1118
|
+
callback: (result: Definition | null) => void,
|
|
1119
|
+
): void;
|
|
1005
1120
|
/**
|
|
1006
1121
|
* Define this if: you want to use custom logic to supply DOM nodes for a given template configuration (e.g., using an ajax request to fetch a template by URL).
|
|
1007
1122
|
* @see {@link https://knockoutjs.com/documentation/component-loaders.html}
|
|
@@ -1017,18 +1132,20 @@ declare namespace KnockoutComponentTypes {
|
|
|
1017
1132
|
|
|
1018
1133
|
interface Definition {
|
|
1019
1134
|
template: Node[];
|
|
1020
|
-
createViewModel?(params: any, options: { element: Node
|
|
1135
|
+
createViewModel?(params: any, options: { element: Node }): any;
|
|
1021
1136
|
}
|
|
1022
1137
|
}
|
|
1023
1138
|
|
|
1024
1139
|
interface KnockoutComponents {
|
|
1025
|
-
|
|
1026
1140
|
/**
|
|
1027
1141
|
* Registers a component, in the default component loader, to be used by name in the component binding.
|
|
1028
1142
|
* @param componentName Component name. Will be used for your custom HTML tag name.
|
|
1029
1143
|
* @param config Component configuration.
|
|
1030
1144
|
*/
|
|
1031
|
-
register<T = KnockoutComponentTypes.ViewModel>(
|
|
1145
|
+
register<T = KnockoutComponentTypes.ViewModel>(
|
|
1146
|
+
componentName: string,
|
|
1147
|
+
config: KnockoutComponentTypes.Config<T> | KnockoutComponentTypes.EmptyConfig,
|
|
1148
|
+
): void;
|
|
1032
1149
|
/**
|
|
1033
1150
|
* Determine if a component with the specified name is already registered in the default component loader.
|
|
1034
1151
|
* @param componentName Component name.
|
|
@@ -1049,7 +1166,7 @@ interface KnockoutComponents {
|
|
|
1049
1166
|
* Clears the cache knockout creates to speed up component loading, for a given component.
|
|
1050
1167
|
* @param componentName Component name.
|
|
1051
1168
|
*/
|
|
1052
|
-
clearCachedDefinition(componentName: string): void
|
|
1169
|
+
clearCachedDefinition(componentName: string): void;
|
|
1053
1170
|
defaultLoader: KnockoutComponentTypes.Loader;
|
|
1054
1171
|
loaders: KnockoutComponentTypes.Loader[];
|
|
1055
1172
|
/**
|
knockout/package.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/knockout",
|
|
3
|
-
"version": "3.4.
|
|
4
|
-
"description": "TypeScript definitions for
|
|
3
|
+
"version": "3.4.74",
|
|
4
|
+
"description": "TypeScript definitions for knockout",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knockout",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|
|
9
9
|
"name": "Boris Yankov",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"githubUsername": "borisyankov",
|
|
11
|
+
"url": "https://github.com/borisyankov"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"name": "Igor Oleinikov",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"githubUsername": "Igorbek",
|
|
16
|
+
"url": "https://github.com/Igorbek"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"name": "Clément Bourgeois",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"githubUsername": "moonpyk",
|
|
21
|
+
"url": "https://github.com/moonpyk"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "Matt Brooks",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"githubUsername": "EnableSoftware",
|
|
26
|
+
"url": "https://github.com/EnableSoftware"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"name": "Benjamin Eckardt",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"githubUsername": "BenjaminEckardt",
|
|
31
|
+
"url": "https://github.com/BenjaminEckardt"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "Mathias Lorenzen",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
35
|
+
"githubUsername": "ffMathy",
|
|
36
|
+
"url": "https://github.com/ffMathy"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"name": "Leonardo Lombardi",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"githubUsername": "ltlombardi",
|
|
41
|
+
"url": "https://github.com/ltlombardi"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"name": "Retsam",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
45
|
+
"githubUsername": "Retsam",
|
|
46
|
+
"url": "https://github.com/Retsam"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"name": "Rey Pena",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"githubUsername": "ReyPena",
|
|
51
|
+
"url": "https://github.com/ReyPena"
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
"main": "",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"scripts": {},
|
|
62
62
|
"dependencies": {},
|
|
63
|
-
"typesPublisherContentHash": "
|
|
64
|
-
"typeScriptVersion": "4.
|
|
63
|
+
"typesPublisherContentHash": "022e6039a360efd84d36f71fc9f72ebf862b42cc8607f446ac589f9c62625b0e",
|
|
64
|
+
"typeScriptVersion": "4.5"
|
|
65
65
|
}
|