UNPKG

@mojir/lits

Version:

Lits is a Lisp dialect implemented in TypeScript

62 lines (61 loc) 7.84 kB
import type { Argument } from '.'; export declare const api: { readonly collection: readonly ["count", "get", "get-in", "contains?", "assoc", "assoc-in", "++", "not-empty", "every?", "not-every?", "any?", "not-any?", "update", "update-in"]; readonly array: readonly ["range", "repeat", "flatten", "mapcat"]; readonly sequence: readonly ["nth", "push", "pop", "unshift", "shift", "slice", "splice", "reductions", "reduce", "reduce-right", "map", "filter", "position", "index-of", "last-index-of", "some", "reverse", "first", "second", "last", "rest", "next", "take", "take-last", "take-while", "drop", "drop-last", "drop-while", "sort", "sort-by", "distinct", "remove", "remove-at", "split-at", "split-with", "frequencies", "group-by", "partition", "partition-all", "partition-by", "starts-with?", "ends-with?", "interleave", "interpose"]; readonly math: readonly ["+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "√", "∛", "**", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh"]; readonly functional: readonly ["apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every-pred", "some-pred", "fnull"]; readonly misc: readonly ["≠", "=", "<", ">", "≤", "≥", "!", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "json-parse", "json-stringify"]; readonly object: readonly ["dissoc", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys"]; readonly predicate: readonly ["boolean?", "null?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?"]; readonly regularExpression: readonly ["regexp", "match", "replace", "replace-all"]; readonly string: readonly ["string-repeat", "str", "number", "lower-case", "upper-case", "trim", "trim-left", "trim-right", "pad-left", "pad-right", "split", "split-lines", "template", "to-char-code", "from-char-code", "encode-base64", "decode-base64", "encode-uri-component", "decode-uri-component", "join", "capitalize", "blank?"]; readonly bitwise: readonly ["<<", ">>", ">>>", "~", "&", "bit-and-not", "|", "^", "bit-flip", "bit-clear", "bit-set", "bit-test"]; readonly assert: readonly ["assert", "assert=", "assert!=", "assert-gt", "assert-lt", "assert-gte", "assert-lte", "assert-true", "assert-false", "assert-truthy", "assert-falsy", "assert-null", "assert-throws", "assert-throws-error", "assert-not-throws"]; readonly shorthand: ["-short-regexp", "-short-fn"]; readonly datatype: ["-type-number", "-type-string", "-type-object", "-type-array", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-null", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"]; }; export type CollectionApiName = typeof api.collection[number]; export type ArrayApiName = typeof api.array[number]; export type SequenceApiName = typeof api.sequence[number]; export type MathApiName = typeof api.math[number]; export type FunctionalApiName = typeof api.functional[number]; export type MiscApiName = typeof api.misc[number]; export type ObjectApiName = typeof api.object[number]; export type PredicateApiName = typeof api.predicate[number]; export type RegularExpressionApiName = typeof api.regularExpression[number]; export type SpecialExpressionsApiName = string; export type StringApiName = typeof api.string[number]; export type BitwiseApiName = typeof api.bitwise[number]; export type AssertApiName = typeof api.assert[number]; export type NormalExpressionName = CollectionApiName | ArrayApiName | SequenceApiName | MathApiName | FunctionalApiName | MiscApiName | ObjectApiName | PredicateApiName | RegularExpressionApiName | StringApiName | BitwiseApiName | AssertApiName; export type FunctionName = NormalExpressionName | SpecialExpressionsApiName; export type ShorthandName = typeof api.shorthand[number]; export type DatatypeName = typeof api.datatype[number]; declare const apiNames: readonly ["count", "get", "get-in", "contains?", "assoc", "assoc-in", "++", "not-empty", "every?", "not-every?", "any?", "not-any?", "update", "update-in", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "splice", "reductions", "reduce", "reduce-right", "map", "filter", "position", "index-of", "last-index-of", "some", "reverse", "first", "second", "last", "rest", "next", "take", "take-last", "take-while", "drop", "drop-last", "drop-while", "sort", "sort-by", "distinct", "remove", "remove-at", "split-at", "split-with", "frequencies", "group-by", "partition", "partition-all", "partition-by", "starts-with?", "ends-with?", "interleave", "interpose", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "√", "∛", "**", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "log", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "apply", "identity", "partial", "comp", "constantly", "juxt", "complement", "every-pred", "some-pred", "fnull", "≠", "=", "<", ">", "≤", "≥", "!", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "json-parse", "json-stringify", "dissoc", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys", "boolean?", "null?", "number?", "string?", "function?", "integer?", "array?", "object?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "regexp", "match", "replace", "replace-all", "string-repeat", "str", "number", "lower-case", "upper-case", "trim", "trim-left", "trim-right", "pad-left", "pad-right", "split", "split-lines", "template", "to-char-code", "from-char-code", "encode-base64", "decode-base64", "encode-uri-component", "decode-uri-component", "join", "capitalize", "blank?", "<<", ">>", ">>>", "~", "&", "bit-and-not", "|", "^", "bit-flip", "bit-clear", "bit-set", "bit-test", "assert", "assert=", "assert!=", "assert-gt", "assert-lt", "assert-gte", "assert-lte", "assert-true", "assert-false", "assert-truthy", "assert-falsy", "assert-null", "assert-throws", "assert-throws-error", "assert-not-throws", "-short-regexp", "-short-fn", "-type-number", "-type-string", "-type-object", "-type-array", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-null", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"]; export type ApiName = typeof apiNames[number]; export declare function isApiName(arg: string): arg is ApiName; export declare const categoryRecord: { readonly 'Special expression': true; readonly Predicate: true; readonly Sequence: true; readonly Collection: true; readonly Array: true; readonly Object: true; readonly String: true; readonly Math: true; readonly Functional: true; readonly 'Regular expression': true; readonly Bitwise: true; readonly Misc: true; readonly Assert: true; readonly Shorthand: true; readonly Datatype: true; }; export type Category = keyof typeof categoryRecord; export declare const categories: Category[]; declare const dataTypes: readonly ["number", "string", "object", "array", "boolean", "function", "integer", "any", "null", "collection", "sequence", "regexp", "never"]; export type DataType = typeof dataTypes[number]; export declare function isDataType(arg: string): arg is DataType; export declare function getOperatorArgs(a: DataType | DataType[], b: DataType | DataType[]): Record<string, Argument>; export {};