Here are some examples you can use as a model when writing your own type definitions.
Exposing a single function.
declare function domready (...): any;
export = domready
Function with overloads.
declare function xtend <A> (a: A): A;
declare function xtend <A, B> (a: A, b: B): A & B;
export = xtend;
Exposing a collection of utility functions and classes.
declare module JsDiff {
class Diff {}
function diffChars(): any;
}
export = JsDiff;
Exposing a function, with utility methods.
declare function tape (): any;
declare namespace tape {
export function skip (): any;
}
export = tape;
declare class Promise <R> {
static resolve(): Promise<void>;
}
declare module Promise {
export interface SpreadOption {}
export function setScheduler (): any;
}
export = Promise;
Export directly using ES6 semantics without a module or namespace.
export function valid(): any;
export class SemVer {}