@mojir/lits 1.2.2-alpha.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/cli.js +541 -1125
- package/dist/cli/src/Lits/Lits.d.ts +1 -6
- package/dist/cli/src/index.d.ts +3 -8
- package/dist/cli/src/tokenizer/tokenizers.d.ts +1 -0
- package/dist/index.esm.js +18 -7442
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -7452
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +17 -7452
- package/dist/lits.iife.js.map +1 -1
- package/dist/src/Lits/Lits.d.ts +1 -6
- package/dist/src/index.d.ts +3 -8
- package/dist/src/tokenizer/tokenizers.d.ts +1 -0
- package/dist/testFramework.esm.js +3 -586
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +3 -586
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/src/identifier.d.ts +0 -8
- package/dist/cli/src/transformer/index.d.ts +0 -2
- package/dist/cli/src/unparser/UnparseOptions.d.ts +0 -15
- package/dist/cli/src/unparser/unparse.d.ts +0 -5
- package/dist/cli/src/unparser/unparseArrayLiteral.d.ts +0 -3
- package/dist/cli/src/unparser/unparseBindings.d.ts +0 -3
- package/dist/cli/src/unparser/unparseNormalExpression.d.ts +0 -3
- package/dist/cli/src/unparser/unparseObjectLiteral.d.ts +0 -3
- package/dist/cli/src/unparser/unparseParams.d.ts +0 -17
- package/dist/cli/src/unparser/unparseSpecialExpression/index.d.ts +0 -3
- package/dist/cli/src/unparser/unparseSpecialExpression/unparseCond.d.ts +0 -3
- package/dist/cli/src/unparser/unparseSpecialExpression/unparseDo.d.ts +0 -3
- package/dist/cli/src/unparser/unparseSpecialExpression/unparseIfLet.d.ts +0 -3
- package/dist/cli/src/unparser/unparseSpecialExpression/unparseIfOrWhenLike.d.ts +0 -6
- package/dist/cli/src/unparser/unparseSpecialExpression/unparseLet.d.ts +0 -3
- package/dist/cli/src/unparser/utils.d.ts +0 -5
- package/dist/cli/src/untokenizer/index.d.ts +0 -2
- package/dist/src/identifier.d.ts +0 -8
- package/dist/src/transformer/index.d.ts +0 -2
- package/dist/src/unparser/UnparseOptions.d.ts +0 -15
- package/dist/src/unparser/__tests__/testFormatter.d.ts +0 -1
- package/dist/src/unparser/unparse.d.ts +0 -5
- package/dist/src/unparser/unparseArrayLiteral.d.ts +0 -3
- package/dist/src/unparser/unparseBindings.d.ts +0 -3
- package/dist/src/unparser/unparseNormalExpression.d.ts +0 -3
- package/dist/src/unparser/unparseObjectLiteral.d.ts +0 -3
- package/dist/src/unparser/unparseParams.d.ts +0 -17
- package/dist/src/unparser/unparseSpecialExpression/index.d.ts +0 -3
- package/dist/src/unparser/unparseSpecialExpression/unparseCond.d.ts +0 -3
- package/dist/src/unparser/unparseSpecialExpression/unparseDo.d.ts +0 -3
- package/dist/src/unparser/unparseSpecialExpression/unparseIfLet.d.ts +0 -3
- package/dist/src/unparser/unparseSpecialExpression/unparseIfOrWhenLike.d.ts +0 -6
- package/dist/src/unparser/unparseSpecialExpression/unparseLet.d.ts +0 -3
- package/dist/src/unparser/utils.d.ts +0 -5
- package/dist/src/untokenizer/index.d.ts +0 -2
package/dist/src/Lits/Lits.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface LazyValue {
|
|
|
15
15
|
}
|
|
16
16
|
export interface JsFunction {
|
|
17
17
|
fn: (...args: any[]) => unknown;
|
|
18
|
+
[key: string]: unknown;
|
|
18
19
|
}
|
|
19
20
|
export interface LitsParams {
|
|
20
21
|
globalContext?: Context;
|
|
@@ -30,9 +31,6 @@ interface LitsConfig {
|
|
|
30
31
|
astCacheSize?: number | null;
|
|
31
32
|
debug?: boolean;
|
|
32
33
|
}
|
|
33
|
-
type FormatParams = LitsParams & {
|
|
34
|
-
lineLength?: number;
|
|
35
|
-
};
|
|
36
34
|
export declare class Lits {
|
|
37
35
|
private astCache;
|
|
38
36
|
private astCacheSize;
|
|
@@ -40,14 +38,11 @@ export declare class Lits {
|
|
|
40
38
|
constructor(config?: LitsConfig);
|
|
41
39
|
getRuntimeInfo(): LitsRuntimeInfo;
|
|
42
40
|
run(program: string, params?: LitsParams): unknown;
|
|
43
|
-
format(program: string, params?: FormatParams): string;
|
|
44
41
|
context(program: string, params?: LitsParams): Context;
|
|
45
42
|
analyze(program: string, params?: LitsParams): Analysis;
|
|
46
43
|
tokenize(program: string, tokenizeParams?: TokenizeParams): TokenStream;
|
|
47
44
|
parse(tokenStream: TokenStream): Ast;
|
|
48
45
|
evaluate(ast: Ast, params: LitsParams): Any;
|
|
49
|
-
transform(tokenStream: TokenStream, transformer: (name: string) => string): TokenStream;
|
|
50
|
-
untokenize(tokenStream: TokenStream): string;
|
|
51
46
|
apply(fn: LitsFunction, fnParams: unknown[], params?: LitsParams): Any;
|
|
52
47
|
private generateAst;
|
|
53
48
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
export { AstNodeType, TokenType, FunctionType } from './constants/constants';
|
|
2
2
|
export { isBuiltinFunction, isLitsFunction, asLitsFunction, assertLitsFunction, isUserDefinedFunction, asUserDefinedFunction, assertUserDefinedFunction, isNativeJsFunction, asNativeJsFunction, assertNativeJsFunction, } from './typeGuards/litsFunction';
|
|
3
|
-
export {
|
|
3
|
+
export type { LitsFunction, NativeJsFunction, ExtraData, Ast } from './parser/interface';
|
|
4
4
|
export type { Context } from './evaluator/interface';
|
|
5
|
-
export type { Ast } from './parser/interface';
|
|
6
5
|
export type { Token, SourceCodeInfo } from './tokenizer/interface';
|
|
6
|
+
export type { UnresolvedIdentifier } from './analyze';
|
|
7
7
|
export { normalExpressionKeys, specialExpressionKeys } from './builtin';
|
|
8
8
|
export { reservedNames } from './reservedNames';
|
|
9
9
|
export { Lits } from './Lits/Lits';
|
|
10
10
|
export { type LitsError, isLitsError } from './errors';
|
|
11
|
-
export type { LitsParams, LitsRuntimeInfo, LazyValue
|
|
11
|
+
export type { LitsParams, LitsRuntimeInfo, LazyValue } from './Lits/Lits';
|
|
12
12
|
export { createNativeJsFunction } from './utils';
|
|
13
|
-
export { apiReference, isDatatypeReference, isFunctionReference, isNormalExpressionArgument, isShorthandReference, isSpecialExpressionArgument, isTypedValue } from '../reference';
|
|
14
|
-
export type { Argument, CommonReference, DatatypeReference, FunctionReference, Reference, ShorthandReference } from '../reference';
|
|
15
|
-
export type { ApiName, FunctionName, ShorthandName, DatatypeName } from '../reference/api';
|
|
16
|
-
export { isApiName, isDataType } from '../reference/api';
|
|
17
|
-
export { type Identifier, assertIdentifier, isIdentifier } from './identifier';
|