DefinitelyTyped/types/text-buffer
2017-10-06 14:03:03 -07:00
..
v0 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
.editorconfig
index.d.ts
README.md
text-buffer-tests.ts
tsconfig.json Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
tslint.json

TextBuffer Type Definitions

TypeScript type definitions for TextBuffer, which is published as "text-buffer" on NPM.

Usage Notes

Exports

This module has a single entity as its export: the TextBuffer class. The require syntax is typically used to import modules like this.

import TextBuffer = require("text-buffer");

Point and Range

Both the Point class and the Range class are anchored onto the TextBuffer class as static properties, allowing construction of both despite TextBuffer being the singular export.

import TextBuffer = require("text-buffer");
let point = new TextBuffer.Point(0, 0);
let range = new TextBuffer.Range([0, 0], [1, 4]);

The TextBuffer Namespace

The three primary classes of TextBuffer are Point, Range, and TextBuffer, yet there are many other types passed around and used by it. Many of the types used by TextBuffer can be referenced from the TextBuffer namespace.

function example(marker: TextBuffer.Marker) {}