declare module 'opentype.js' {
  interface Glyph {
    advanceWidth: number;
    getPath(x: number, y: number, fontSize: number): Path;
  }

  interface PathCommand {
    type: string;
    x?: number;
    y?: number;
    x1?: number;
    y1?: number;
    x2?: number;
    y2?: number;
  }

  interface Path {
    commands: PathCommand[];
    toPathData(decimalPlaces?: number): string;
  }

  interface Font {
    unitsPerEm: number;
    ascender: number;
    descender: number;
    charToGlyph(char: string): Glyph;
    getPath(text: string, x: number, y: number, fontSize: number): Path;
    stringToGlyphs(text: string): Glyph[];
  }

  export function parse(buffer: ArrayBuffer): Font;
  export function load(url: string, callback: (err: Error | null, font?: Font) => void): void;
}
