-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ClosureCompiler syntax "typeof T" (#128)
* add typeof tests * add support for typeof syntax * update readme
- Loading branch information
1 parent
458f5b6
commit fe18a88
Showing
5 changed files
with
76 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
declare class Foobar1 { | ||
x: typeof MyClass; | ||
y: typeof MyClass; | ||
z: string | typeof MyClass; | ||
u: typeof MyClass | string; | ||
v: (typeof MyClass)[]; | ||
w: typeof Array; | ||
q: typeof Array; | ||
r: typeof Class; | ||
s: typeof Array; | ||
} | ||
|
||
declare class Foobar2 { | ||
x: typeof MyClass; | ||
y: typeof MyClass; | ||
z: string | typeof MyClass; | ||
u: typeof MyClass | string; | ||
v: (typeof MyClass)[]; | ||
w: typeof Array; | ||
q: typeof Array; | ||
r: typeof Class; | ||
s: typeof Array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @property {Class<MyClass>} x | ||
* @property {Class.< MyClass >} y | ||
* @property {string|Class<MyClass>} z | ||
* @property {Class<MyClass>|string} u | ||
* @property {Array<Class<MyClass>>} v | ||
* @property {Class<Array<MyClass>>} w | ||
* @property {Class<MyClass[]>} q | ||
* @property {Class<Class<MyClass>>} r | ||
* @property {Class<Array<Class<MyClass>>>} s | ||
*/ | ||
class Foobar1 {} | ||
|
||
/** | ||
* @property {typeof MyClass} x | ||
* @property {typeof MyClass } y | ||
* @property {string|typeof MyClass} z | ||
* @property {typeof MyClass|string} u | ||
* @property {Array<typeof MyClass>} v | ||
* @property {typeof Array<MyClass>} w | ||
* @property {typeof MyClass[]} q | ||
* @property {typeof typeof MyClass} r | ||
* @property {typeof Array<typeof MyClass>} s | ||
*/ | ||
class Foobar2 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { expectJsDoc } from '../lib'; | ||
|
||
suite('Typeof Checks', () => { | ||
test('All', () => { | ||
expectJsDoc('typeof_all'); | ||
}); | ||
}); |