mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
ko.unwrap uses union types
This commit is contained in:
Vendored
+1
-1
@@ -442,7 +442,7 @@ interface KnockoutStatic {
|
||||
cleanNode(node: Element): Element;
|
||||
renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any): any;
|
||||
renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any): any;
|
||||
unwrap(value: any): any;
|
||||
unwrap<T>(value: KnockoutObservable<T> | T): T;
|
||||
|
||||
computedContext: KnockoutComputedContext;
|
||||
|
||||
|
||||
@@ -648,4 +648,11 @@ function test_Components() {
|
||||
// Empty config for registering custom elements that are handled by name convention
|
||||
ko.components.register('name', { /* No config needed */ });
|
||||
}
|
||||
}
|
||||
|
||||
function testUnwrapUnion() {
|
||||
|
||||
var possibleObs: KnockoutObservable<number> | number;
|
||||
var num = ko.unwrap(possibleObs);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user