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
import ts from 'typescript'; | |
const typeNode = ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword); | |
ts.addSyntheticLeadingComment( | |
typeNode, | |
ts.SyntaxKind.MultiLineCommentTrivia, | |
'A Type Node Comment', | |
false | |
); | |
const prop = ts.createPropertySignature( |
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
import * as ts from 'typescript'; | |
const data = ts.createModuleDeclaration( | |
undefined, | |
[ts.createModifier(ts.SyntaxKind.DeclareKeyword)], | |
ts.createIdentifier("Components"), | |
ts.createModuleBlock([ts.createModuleDeclaration( | |
undefined, | |
undefined, | |
ts.createIdentifier("Schemas"), |
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
import * as ts from 'typescript'; | |
const source = ts.createSourceFile('declare.d.ts', '', ts.ScriptTarget.ES2015); | |
const syntheticNode = ts.createClassDeclaration( | |
undefined, | |
undefined, | |
ts.createIdentifier('C'), | |
undefined, | |
undefined, |
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
/// <reference path="./superagent.d.ts" /> | |
/// <reference path="../node/node.d.ts" /> | |
// via: http://visionmedia.github.io/superagent/ | |
import request = require('superagent') | |
import fs = require('fs'); | |
request | |
.post('/api/pet') |
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
// You are not permitted to use these List methods: | |
// * length | |
// * map | |
// * filter | |
// * ::: (and variations such as ++) | |
// * flatten | |
// * flatMap | |
// * reverse (and variations i.e. reverseMap, reverse_:::) | |
// This also means you are not permitted to use for-comprehensions on Lists. | |
// You are permitted to use the functions you write yourself. For example, Exercise 2 may use Exercise 1 or Exercise 3. |
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
#include <array> | |
template <typename T, typename ...Args> | |
inline std::array<T, sizeof...(Args)> make_array(Args &&...args) { | |
return std::array<T, sizeof...(Args)>{ std::forward<Args>(args)... }; | |
} | |
#define MAKE_ARRAY(T, ...) decltype(make_array<T>(__VA_ARGS__)){__VA_ARGS__} | |
#include <typeinfo> |