Files
DefinitelyTyped/types/antlr4/CharStreams.d.ts
Alex Miller 7f757779c4 🤖 Merge PR #62582 [Antlr] Add and fix types for Antlr 4.11 by @Codex-
* antlr: Update tree typings

* antlr: Add some misc typings.

* antlr: Update error types.

* antlr: Add some atn types.

* antlr: Add some contexts.

* antlr: Add some state.

* antlr: Add various.

* antlr: Add some root level types.

* antlr: Complete more types from Parser to dependents.

* antlr: Add many atn types.

* antlr: Finish atn types.

* antlr: Finish DFA types.

* antlr: Clean up types.

* antlr: add utils tests.

* antlr: add dfa tests.

* antlr: add atn tests.

* antlr: add more atn tests.

* antlr: finish atn tests.

* antlr: add action tests.

* antlr: add context tests.

* antlr: finish dfa tests.

* antlr: add error tests.

* antlr: add misc tests.

* antlr: add state tests.

* antlr: add transition tests.

* antlr: add tree tests.

* antlr: add root tests.

* antlr: remove relying on lib.dom.

* antlr: lexer technically handles null.

* antlr4-autosuggest: Update to use new types

* antlr: ParserRuleContext child method actually returns a base ParseTree.
2022-11-02 13:34:43 -07:00

49 lines
1.5 KiB
TypeScript

import InputStream from './InputStream';
declare namespace CharStreams {
/**
* Creates an InputStream from a string.
*/
function fromString(str: string): InputStream;
/**
* Asynchronously creates an InputStream from a blob given the
* encoding of the bytes in that blob (defaults to 'utf8' if
* encoding is null).
*
* Invokes onLoad(result) on success, onError(error) on
* failure.
*/
function fromBlob(
blob: any,
encoding: string,
onLoad: (is: InputStream) => void,
onError: ((event: any) => any) | null,
): void;
/**
* Creates an InputStream from a Buffer given the
* encoding of the bytes in that buffer (defaults to 'utf8' if
* encoding is null).
*/
function fromBuffer(buffer: any, encoding: string): InputStream;
/**
* Asynchronously creates an InputStream from a file on disk given
* the encoding of the bytes in that file (defaults to 'utf8' if
* encoding is null).
*
* Invokes callback(error, result) on completion.
*/
function fromPath(path: any, encoding: string, callback: (err: any, is: InputStream) => void): void;
/**
* Synchronously creates an InputStream given a path to a file
* on disk and the encoding of the bytes in that file (defaults to
* 'utf8' if encoding is null).
*/
function fromPathSync(path: any, encoding: string): InputStream;
}
export default CharStreams;