Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Hybrid Types section expansion #23

Open
starksm64 opened this issue Apr 24, 2015 · 1 comment
Open

Hybrid Types section expansion #23

starksm64 opened this issue Apr 24, 2015 · 1 comment
Labels

Comments

@starksm64
Copy link

I was having a hard time understanding how one would create a class implementing a hybrid type, and then ran across this posting which explained this issue:
http://stackoverflow.com/questions/25340601/typescript-hybrid-type-implementation

It would be nice of the Hybrid Types section could include an example function returning the hybrid type as was done in the posting, and further explain that one cannot create a TypeScript class that implements a hybrid type interface.

function getCounter():Counter{
var counter = function(start:number){};
counter.interval = 123;
counter.reset = function(){};
return counter;
}

var c: Counter = getCounter();
...

starksm64 added a commit to starksm64/TypeScript-Handbook that referenced this issue Apr 24, 2015
@starksm64
Copy link
Author

See #24

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants