Skip to content

Commit

Permalink
Set up a test for the d.ts 'prototype class' pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mcclure committed Aug 9, 2016
1 parent 1efb636 commit c141f4d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/tsGlue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,21 @@ class QCrecursive2 {

// Ugly way to access global variable
let QFbackflow = () : number => (<any>this).QBbackflow

// A pattern lib.d.ts frequently follows.
interface QCproto {
num5: number
func6(v: number) : number
}

interface QCprototheconstructor {
new (value: number): QCproto
prototype: QCproto
}

class QCimplforproto implements QCproto {
constructor(public num5: number) {}
func6(v:number) { return this.num5 + v }
}

var QCproto: QCprototheconstructor = QCimplforproto

0 comments on commit c141f4d

Please sign in to comment.