DefinitelyTyped/types/text-buffer
Glen M ea4008d4e8 Add definitions for atom-mocha-test-runner. (#20380)
* Add definitions for atom-mocha-test-runner.

* Remove the editorconfig.

* Atom: remove editorconfigs, linebreak-style, and all lint disables.
2017-10-09 15:43:18 -07:00
..
v0 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
index.d.ts
README.md
text-buffer-tests.ts
tsconfig.json Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
tslint.json Add definitions for atom-mocha-test-runner. (#20380) 2017-10-09 15:43:18 -07:00

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) {}