Last active
May 5, 2016 06:32
-
-
Save chyld/5e6405dc97fc2e9b71894ac9a5dc5e29 to your computer and use it in GitHub Desktop.
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
types: | |
boolean, number, string, number[], [string, number], enum, any, void | |
cast: | |
<string>val or (val as string).length | |
declarations: | |
var, let, const | |
destructuring: | |
let [, second, , fourth, ...rest] = [1, 2, 3, 4, 5, 6, 7]; | |
let {a, b} = {a:3, b:2}; | |
interfaces: | |
interface MyType { | |
label: string; | |
color?: string; | |
[propName: string]: any; | |
(source: string, subString: string): boolean; | |
currentTime: Date; | |
setTime(d: Date); | |
} | |
classes: | |
functions: | |
function add(x: number, y?: number, c = 3, ...rest): number { | |
return x + y; | |
} | |
generics: | |
function identity<T>(arg: T): T { | |
return arg; | |
} | |
union types: | |
function padLeft(value: string, padding: string | number) { | |
} | |
intersection types: | |
a & b | |
type aliases: | |
type Name = string; | |
modules: | |
namespaces: | |
decorators: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment