diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 3ac8d0a0e..c68c38aff 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -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(value: KnockoutObservable | T): T; computedContext: KnockoutComputedContext; diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 64a91d199..78d464f07 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -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; + var num = ko.unwrap(possibleObs); + } \ No newline at end of file