@tsonic/globals
v0.3.2
Published
Global type definitions for Tsonic with BCL primitive methods
Maintainers
Readme
@tsonic/globals
Global type definitions for Tsonic.
This package provides:
- Base types required by TypeScript (Array, String, Object, Function, etc.)
- Shared types used by both modes (utility types, iterators, Promise, Symbol)
Usage
Dotnet mode (use this package alone)
npm install @tsonic/globals{
"compilerOptions": {
"noLib": true,
"typeRoots": ["node_modules/@tsonic/globals"]
}
}Arrays use LINQ, strings use BCL methods.
JS mode (use with @tsonic/js-globals)
npm install @tsonic/globals @tsonic/js-globals{
"compilerOptions": {
"noLib": true,
"typeRoots": [
"node_modules/@tsonic/globals",
"node_modules/@tsonic/js-globals"
]
}
}Arrays have .map, .filter, .length, etc. Strings have .slice, .indexOf, etc.
What's included
Base types (minimal definitions)
Array<T>,ReadonlyArray<T>- indexer and iterator onlyString,Number,Boolean- empty baseObject,Function- minimalRegExp,IArguments,CallableFunction,NewableFunction
Utility types
Partial,Required,Readonly,Pick,OmitRecord,Exclude,Extract,NonNullableParameters,ReturnType,InstanceType,ConstructorParameters
Iterator/Generator types
Iterator,IteratorResult,Iterable,IterableIteratorAsyncIterator,AsyncIterable,AsyncIterableIteratorGenerator,AsyncGenerator
Promise types
Promise,PromiseLike,PromiseConstructor
Other
Symbol,SymbolConstructorPropertyKey- Template literal utilities:
Uppercase,Lowercase,Capitalize,Uncapitalize
License
MIT
