UNPKG

llama-cpp-capacitor

Version:

A native Capacitor plugin that embeds llama.cpp directly into mobile apps, enabling offline AI inference with chat-first API design. Complete iOS and Android support: text generation, chat, multimodal, TTS, LoRA, embeddings, and more.

1,661 lines (1,660 loc) 249 kB
{ "api": { "name": "LlamaCppPlugin", "slug": "llamacppplugin", "docs": "", "tags": [], "methods": [ { "name": "toggleNativeLog", "signature": "(options: { enabled: boolean; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ enabled: boolean; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "togglenativelog" }, { "name": "setContextLimit", "signature": "(options: { limit: number; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ limit: number; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "setcontextlimit" }, { "name": "modelInfo", "signature": "(options: { path: string; skip?: string[]; }) => Promise<Object>", "parameters": [ { "name": "options", "docs": "", "type": "{ path: string; skip?: string[] | undefined; }" } ], "returns": "Promise<Object>", "tags": [], "docs": "", "complexTypes": [ "Object" ], "slug": "modelinfo" }, { "name": "initContext", "signature": "(options: { contextId: number; params: NativeContextParams; }) => Promise<NativeLlamaContext>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; params: NativeContextParams; }" } ], "returns": "Promise<NativeLlamaContext>", "tags": [], "docs": "", "complexTypes": [ "NativeLlamaContext", "NativeContextParams" ], "slug": "initcontext" }, { "name": "releaseContext", "signature": "(options: { contextId: number; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "releasecontext" }, { "name": "releaseAllContexts", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "releaseallcontexts" }, { "name": "getFormattedChat", "signature": "(options: { contextId: number; messages: string; chatTemplate?: string; params?: { jinja?: boolean; json_schema?: string; tools?: string; parallel_tool_calls?: string; tool_choice?: string; enable_thinking?: boolean; add_generation_prompt?: boolean; now?: string; chat_template_kwargs?: string; }; }) => Promise<JinjaFormattedChatResult | string>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; messages: string; chatTemplate?: string | undefined; params?: { jinja?: boolean | undefined; json_schema?: string | undefined; tools?: string | undefined; parallel_tool_calls?: string | undefined; tool_choice?: string | undefined; enable_thinking?: boolean | undefined; add_generation_prompt?: boolean | undefined; now?: string | undefined; chat_template_kwargs?: string | undefined; } | undefined; }" } ], "returns": "Promise<string | JinjaFormattedChatResult>", "tags": [], "docs": "", "complexTypes": [ "JinjaFormattedChatResult" ], "slug": "getformattedchat" }, { "name": "completion", "signature": "(options: { contextId: number; params: NativeCompletionParams; }) => Promise<NativeCompletionResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; params: NativeCompletionParams; }" } ], "returns": "Promise<NativeCompletionResult>", "tags": [], "docs": "", "complexTypes": [ "NativeCompletionResult", "NativeCompletionParams" ], "slug": "completion" }, { "name": "chat", "signature": "(options: { contextId: number; messages: LlamaCppOAICompatibleMessage[]; system?: string; chatTemplate?: string; params?: Omit<NativeCompletionParams, 'prompt' | 'messages'>; }) => Promise<NativeCompletionResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; messages: LlamaCppOAICompatibleMessage[]; system?: string | undefined; chatTemplate?: string | undefined; params?: Omit<NativeCompletionParams, 'prompt' | 'messages'> | undefined; }" } ], "returns": "Promise<NativeCompletionResult>", "tags": [], "docs": "", "complexTypes": [ "NativeCompletionResult", "LlamaCppOAICompatibleMessage", "Omit", "NativeCompletionParams" ], "slug": "chat" }, { "name": "chatWithSystem", "signature": "(options: { contextId: number; system: string; message: string; params?: Omit<NativeCompletionParams, 'prompt' | 'messages'>; }) => Promise<NativeCompletionResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; system: string; message: string; params?: Omit<NativeCompletionParams, 'prompt' | 'messages'> | undefined; }" } ], "returns": "Promise<NativeCompletionResult>", "tags": [], "docs": "", "complexTypes": [ "NativeCompletionResult", "Omit", "NativeCompletionParams" ], "slug": "chatwithsystem" }, { "name": "generateText", "signature": "(options: { contextId: number; prompt: string; params?: Omit<NativeCompletionParams, 'prompt' | 'messages'>; }) => Promise<NativeCompletionResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; prompt: string; params?: Omit<NativeCompletionParams, 'prompt' | 'messages'> | undefined; }" } ], "returns": "Promise<NativeCompletionResult>", "tags": [], "docs": "", "complexTypes": [ "NativeCompletionResult", "Omit", "NativeCompletionParams" ], "slug": "generatetext" }, { "name": "stopCompletion", "signature": "(options: { contextId: number; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "stopcompletion" }, { "name": "loadSession", "signature": "(options: { contextId: number; filepath: string; }) => Promise<NativeSessionLoadResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; filepath: string; }" } ], "returns": "Promise<NativeSessionLoadResult>", "tags": [], "docs": "", "complexTypes": [ "NativeSessionLoadResult" ], "slug": "loadsession" }, { "name": "saveSession", "signature": "(options: { contextId: number; filepath: string; size: number; }) => Promise<number>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; filepath: string; size: number; }" } ], "returns": "Promise<number>", "tags": [], "docs": "", "complexTypes": [], "slug": "savesession" }, { "name": "tokenize", "signature": "(options: { contextId: number; text: string; imagePaths?: Array<string>; }) => Promise<NativeTokenizeResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; text: string; imagePaths?: string[] | undefined; }" } ], "returns": "Promise<NativeTokenizeResult>", "tags": [], "docs": "", "complexTypes": [ "NativeTokenizeResult", "Array" ], "slug": "tokenize" }, { "name": "detokenize", "signature": "(options: { contextId: number; tokens: number[]; }) => Promise<string>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; tokens: number[]; }" } ], "returns": "Promise<string>", "tags": [], "docs": "", "complexTypes": [], "slug": "detokenize" }, { "name": "embedding", "signature": "(options: { contextId: number; text: string; params: NativeEmbeddingParams; }) => Promise<NativeEmbeddingResult>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; text: string; params: NativeEmbeddingParams; }" } ], "returns": "Promise<NativeEmbeddingResult>", "tags": [], "docs": "", "complexTypes": [ "NativeEmbeddingResult", "NativeEmbeddingParams" ], "slug": "embedding" }, { "name": "rerank", "signature": "(options: { contextId: number; query: string; documents: Array<string>; params?: NativeRerankParams; }) => Promise<Array<NativeRerankResult>>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; query: string; documents: string[]; params?: NativeRerankParams | undefined; }" } ], "returns": "Promise<NativeRerankResult[]>", "tags": [], "docs": "", "complexTypes": [ "NativeRerankResult", "Array", "NativeRerankParams" ], "slug": "rerank" }, { "name": "bench", "signature": "(options: { contextId: number; pp: number; tg: number; pl: number; nr: number; }) => Promise<string>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; pp: number; tg: number; pl: number; nr: number; }" } ], "returns": "Promise<string>", "tags": [], "docs": "", "complexTypes": [], "slug": "bench" }, { "name": "applyLoraAdapters", "signature": "(options: { contextId: number; loraAdapters: Array<{ path: string; scaled?: number; }>; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; loraAdapters: { path: string; scaled?: number | undefined; }[]; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [ "Array" ], "slug": "applyloraadapters" }, { "name": "removeLoraAdapters", "signature": "(options: { contextId: number; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "removeloraadapters" }, { "name": "getLoadedLoraAdapters", "signature": "(options: { contextId: number; }) => Promise<Array<{ path: string; scaled?: number; }>>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<{ path: string; scaled?: number | undefined; }[]>", "tags": [], "docs": "", "complexTypes": [ "Array" ], "slug": "getloadedloraadapters" }, { "name": "initMultimodal", "signature": "(options: { contextId: number; params: { path: string; use_gpu: boolean; }; }) => Promise<boolean>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; params: { path: string; use_gpu: boolean; }; }" } ], "returns": "Promise<boolean>", "tags": [], "docs": "", "complexTypes": [], "slug": "initmultimodal" }, { "name": "isMultimodalEnabled", "signature": "(options: { contextId: number; }) => Promise<boolean>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<boolean>", "tags": [], "docs": "", "complexTypes": [], "slug": "ismultimodalenabled" }, { "name": "getMultimodalSupport", "signature": "(options: { contextId: number; }) => Promise<{ vision: boolean; audio: boolean; }>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<{ vision: boolean; audio: boolean; }>", "tags": [], "docs": "", "complexTypes": [], "slug": "getmultimodalsupport" }, { "name": "releaseMultimodal", "signature": "(options: { contextId: number; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "releasemultimodal" }, { "name": "initVocoder", "signature": "(options: { contextId: number; params: { path: string; n_batch?: number; }; }) => Promise<boolean>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; params: { path: string; n_batch?: number | undefined; }; }" } ], "returns": "Promise<boolean>", "tags": [], "docs": "", "complexTypes": [], "slug": "initvocoder" }, { "name": "isVocoderEnabled", "signature": "(options: { contextId: number; }) => Promise<boolean>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<boolean>", "tags": [], "docs": "", "complexTypes": [], "slug": "isvocoderenabled" }, { "name": "getFormattedAudioCompletion", "signature": "(options: { contextId: number; speakerJsonStr: string; textToSpeak: string; }) => Promise<{ prompt: string; grammar?: string; }>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; speakerJsonStr: string; textToSpeak: string; }" } ], "returns": "Promise<{ prompt: string; grammar?: string | undefined; }>", "tags": [], "docs": "", "complexTypes": [], "slug": "getformattedaudiocompletion" }, { "name": "getAudioCompletionGuideTokens", "signature": "(options: { contextId: number; textToSpeak: string; }) => Promise<Array<number>>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; textToSpeak: string; }" } ], "returns": "Promise<number[]>", "tags": [], "docs": "", "complexTypes": [ "Array" ], "slug": "getaudiocompletionguidetokens" }, { "name": "decodeAudioTokens", "signature": "(options: { contextId: number; tokens: number[]; }) => Promise<Array<number>>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; tokens: number[]; }" } ], "returns": "Promise<number[]>", "tags": [], "docs": "", "complexTypes": [ "Array" ], "slug": "decodeaudiotokens" }, { "name": "releaseVocoder", "signature": "(options: { contextId: number; }) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "{ contextId: number; }" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "releasevocoder" }, { "name": "downloadModel", "signature": "(options: { url: string; filename: string; }) => Promise<string>", "parameters": [ { "name": "options", "docs": "", "type": "{ url: string; filename: string; }" } ], "returns": "Promise<string>", "tags": [], "docs": "", "complexTypes": [], "slug": "downloadmodel" }, { "name": "getDownloadProgress", "signature": "(options: { url: string; }) => Promise<{ progress: number; completed: boolean; failed: boolean; errorMessage?: string; localPath?: string; downloadedBytes: number; totalBytes: number; }>", "parameters": [ { "name": "options", "docs": "", "type": "{ url: string; }" } ], "returns": "Promise<{ progress: number; completed: boolean; failed: boolean; errorMessage?: string | undefined; localPath?: string | undefined; downloadedBytes: number; totalBytes: number; }>", "tags": [], "docs": "", "complexTypes": [], "slug": "getdownloadprogress" }, { "name": "cancelDownload", "signature": "(options: { url: string; }) => Promise<boolean>", "parameters": [ { "name": "options", "docs": "", "type": "{ url: string; }" } ], "returns": "Promise<boolean>", "tags": [], "docs": "", "complexTypes": [], "slug": "canceldownload" }, { "name": "getAvailableModels", "signature": "() => Promise<Array<{ name: string; path: string; size: number; }>>", "parameters": [], "returns": "Promise<{ name: string; path: string; size: number; }[]>", "tags": [], "docs": "", "complexTypes": [ "Array" ], "slug": "getavailablemodels" }, { "name": "convertJsonSchemaToGrammar", "signature": "(options: { schema: string; }) => Promise<string>", "parameters": [ { "name": "options", "docs": "", "type": "{ schema: string; }" } ], "returns": "Promise<string>", "tags": [], "docs": "", "complexTypes": [], "slug": "convertjsonschematogrammar" }, { "name": "addListener", "signature": "(eventName: string, listenerFunc: (data: any) => void) => Promise<void>", "parameters": [ { "name": "eventName", "docs": "", "type": "string" }, { "name": "listenerFunc", "docs": "", "type": "(data: any) => void" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "addlistenerstring-" }, { "name": "removeAllListeners", "signature": "(eventName: string) => Promise<void>", "parameters": [ { "name": "eventName", "docs": "", "type": "string" } ], "returns": "Promise<void>", "tags": [], "docs": "", "complexTypes": [], "slug": "removealllisteners" } ], "properties": [] }, "interfaces": [ { "name": "Object", "slug": "object", "docs": "Provides functionality common to all JavaScript objects.", "tags": [], "methods": [ { "name": "toString", "signature": "() => string", "parameters": [], "returns": "string", "tags": [], "docs": "Returns a string representation of an object.", "complexTypes": [], "slug": "tostring" }, { "name": "toLocaleString", "signature": "() => string", "parameters": [], "returns": "string", "tags": [], "docs": "Returns a date converted to a string using the current locale.", "complexTypes": [], "slug": "tolocalestring" }, { "name": "valueOf", "signature": "() => Object", "parameters": [], "returns": "Object", "tags": [], "docs": "Returns the primitive value of the specified object.", "complexTypes": [ "Object" ], "slug": "valueof" }, { "name": "hasOwnProperty", "signature": "(v: PropertyKey) => boolean", "parameters": [ { "name": "v", "docs": "A property name.", "type": "PropertyKey" } ], "returns": "boolean", "tags": [ { "name": "param", "text": "v A property name." } ], "docs": "Determines whether an object has a property with the specified name.", "complexTypes": [ "PropertyKey" ], "slug": "hasownproperty" }, { "name": "isPrototypeOf", "signature": "(v: Object) => boolean", "parameters": [ { "name": "v", "docs": "Another object whose prototype chain is to be checked.", "type": "Object" } ], "returns": "boolean", "tags": [ { "name": "param", "text": "v Another object whose prototype chain is to be checked." } ], "docs": "Determines whether an object exists in another object's prototype chain.", "complexTypes": [ "Object" ], "slug": "isprototypeof" }, { "name": "propertyIsEnumerable", "signature": "(v: PropertyKey) => boolean", "parameters": [ { "name": "v", "docs": "A property name.", "type": "PropertyKey" } ], "returns": "boolean", "tags": [ { "name": "param", "text": "v A property name." } ], "docs": "Determines whether a specified property is enumerable.", "complexTypes": [ "PropertyKey" ], "slug": "propertyisenumerable" } ], "properties": [ { "name": "constructor", "tags": [], "docs": "The initial value of Object.prototype.constructor is the standard built-in Object constructor.", "complexTypes": [ "Function" ], "type": "Function" } ] }, { "name": "Function", "slug": "function", "docs": "Creates a new function.", "tags": [], "methods": [ { "name": "apply", "signature": "(this: Function, thisArg: any, argArray?: any) => any", "parameters": [ { "name": "thisArg", "docs": "The object to be used as the this object.", "type": "any" }, { "name": "argArray", "docs": "A set of arguments to be passed to the function.", "type": "any" } ], "returns": "any", "tags": [ { "name": "param", "text": "thisArg The object to be used as the this object." }, { "name": "param", "text": "argArray A set of arguments to be passed to the function." } ], "docs": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", "complexTypes": [ "Function" ], "slug": "apply" }, { "name": "call", "signature": "(this: Function, thisArg: any, ...argArray: any[]) => any", "parameters": [ { "name": "thisArg", "docs": "The object to be used as the current object.", "type": "any" }, { "name": "argArray", "docs": "A list of arguments to be passed to the method.", "type": "any[]" } ], "returns": "any", "tags": [ { "name": "param", "text": "thisArg The object to be used as the current object." }, { "name": "param", "text": "argArray A list of arguments to be passed to the method." } ], "docs": "Calls a method of an object, substituting another object for the current object.", "complexTypes": [ "Function" ], "slug": "call" }, { "name": "bind", "signature": "(this: Function, thisArg: any, ...argArray: any[]) => any", "parameters": [ { "name": "thisArg", "docs": "An object to which the this keyword can refer inside the new function.", "type": "any" }, { "name": "argArray", "docs": "A list of arguments to be passed to the new function.", "type": "any[]" } ], "returns": "any", "tags": [ { "name": "param", "text": "thisArg An object to which the this keyword can refer inside the new function." }, { "name": "param", "text": "argArray A list of arguments to be passed to the new function." } ], "docs": "For a given function, creates a bound function that has the same body as the original function.\r\nThe this object of the bound function is associated with the specified object, and has the specified initial parameters.", "complexTypes": [ "Function" ], "slug": "bind" }, { "name": "toString", "signature": "() => string", "parameters": [], "returns": "string", "tags": [], "docs": "Returns a string representation of a function.", "complexTypes": [], "slug": "tostring" } ], "properties": [ { "name": "prototype", "tags": [], "docs": "", "complexTypes": [], "type": "any" }, { "name": "length", "tags": [], "docs": "", "complexTypes": [], "type": "number" }, { "name": "arguments", "tags": [], "docs": "", "complexTypes": [], "type": "any" }, { "name": "caller", "tags": [], "docs": "", "complexTypes": [ "Function" ], "type": "Function" } ] }, { "name": "FunctionDeclaration", "slug": "functiondeclaration", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "id", "tags": [], "docs": "It is null when a function declaration is a part of the `export default function` statement", "complexTypes": [ "Identifier" ], "type": "Identifier" } ] }, { "name": "Identifier", "slug": "identifier", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "type", "tags": [], "docs": "", "complexTypes": [], "type": "'Identifier'" }, { "name": "name", "tags": [], "docs": "", "complexTypes": [], "type": "string" } ] }, { "name": "FunctionExpression", "slug": "functionexpression", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "id", "tags": [], "docs": "", "complexTypes": [ "Identifier" ], "type": "Identifier | null | undefined" }, { "name": "type", "tags": [], "docs": "", "complexTypes": [], "type": "'FunctionExpression'" }, { "name": "body", "tags": [], "docs": "", "complexTypes": [ "BlockStatement" ], "type": "BlockStatement" } ] }, { "name": "BlockStatement", "slug": "blockstatement", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "type", "tags": [], "docs": "", "complexTypes": [], "type": "'BlockStatement'" }, { "name": "body", "tags": [], "docs": "", "complexTypes": [ "Statement" ], "type": "Statement[]" }, { "name": "innerComments", "tags": [], "docs": "", "complexTypes": [ "Comment" ], "type": "Comment[] | undefined" } ] }, { "name": "ExpressionStatement", "slug": "expressionstatement", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "type", "tags": [], "docs": "", "complexTypes": [], "type": "'ExpressionStatement'" }, { "name": "expression", "tags": [], "docs": "", "complexTypes": [ "Expression" ], "type": "Expression" } ] }, { "name": "ExpressionMap", "slug": "expressionmap", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "ArrayExpression", "tags": [], "docs": "", "complexTypes": [ "ArrayExpression" ], "type": "ArrayExpression" }, { "name": "ArrowFunctionExpression", "tags": [], "docs": "", "complexTypes": [ "ArrowFunctionExpression" ], "type": "ArrowFunctionExpression" }, { "name": "AssignmentExpression", "tags": [], "docs": "", "complexTypes": [ "AssignmentExpression" ], "type": "AssignmentExpression" }, { "name": "AwaitExpression", "tags": [], "docs": "", "complexTypes": [ "AwaitExpression" ], "type": "AwaitExpression" }, { "name": "BinaryExpression", "tags": [], "docs": "", "complexTypes": [ "BinaryExpression" ], "type": "BinaryExpression" }, { "name": "CallExpression", "tags": [], "docs": "", "complexTypes": [ "CallExpression" ], "type": "CallExpression" }, { "name": "ChainExpression", "tags": [], "docs": "", "complexTypes": [ "ChainExpression" ], "type": "ChainExpression" }, { "name": "ClassExpression", "tags": [], "docs": "", "complexTypes": [ "ClassExpression" ], "type": "ClassExpression" }, { "name": "ConditionalExpression", "tags": [], "docs": "", "complexTypes": [ "ConditionalExpression" ], "type": "ConditionalExpression" }, { "name": "FunctionExpression", "tags": [], "docs": "", "complexTypes": [ "FunctionExpression" ], "type": "FunctionExpression" }, { "name": "Identifier", "tags": [], "docs": "", "complexTypes": [ "Identifier" ], "type": "Identifier" }, { "name": "ImportExpression", "tags": [], "docs": "", "complexTypes": [ "ImportExpression" ], "type": "ImportExpression" }, { "name": "Literal", "tags": [], "docs": "", "complexTypes": [ "Literal" ], "type": "Literal" }, { "name": "LogicalExpression", "tags": [], "docs": "", "complexTypes": [ "LogicalExpression" ], "type": "LogicalExpression" }, { "name": "MemberExpression", "tags": [], "docs": "", "complexTypes": [ "MemberExpression" ], "type": "MemberExpression" }, { "name": "MetaProperty", "tags": [], "docs": "", "complexTypes": [ "MetaProperty" ], "type": "MetaProperty" }, { "name": "NewExpression", "tags": [], "docs": "", "complexTypes": [ "NewExpression" ], "type": "NewExpression" }, { "name": "ObjectExpression", "tags": [], "docs": "", "complexTypes": [ "ObjectExpression" ], "type": "ObjectExpression" }, { "name": "SequenceExpression", "tags": [], "docs": "", "complexTypes": [ "SequenceExpression" ], "type": "SequenceExpression" }, { "name": "TaggedTemplateExpression", "tags": [], "docs": "", "complexTypes": [ "TaggedTemplateExpression" ], "type": "TaggedTemplateExpression" }, { "name": "TemplateLiteral", "tags": [], "docs": "", "complexTypes": [ "TemplateLiteral" ], "type": "TemplateLiteral" }, { "name": "ThisExpression", "tags": [], "docs": "", "complexTypes": [ "ThisExpression" ], "type": "ThisExpression" }, { "name": "UnaryExpression", "tags": [], "docs": "", "complexTypes": [ "UnaryExpression" ], "type": "UnaryExpression" }, { "name": "UpdateExpression", "tags": [], "docs": "", "complexTypes": [ "UpdateExpression" ], "type": "UpdateExpression" }, { "name": "YieldExpression", "tags": [], "docs": "", "complexTypes": [ "YieldExpression" ], "type": "YieldExpression" } ] }, { "name": "ArrayExpression", "slug": "arrayexpression", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "type", "tags": [], "docs": "", "complexTypes": [], "type": "'ArrayExpression'" }, { "name": "elements", "tags": [], "docs": "", "complexTypes": [ "Array", "Expression", "SpreadElement" ], "type": "Array<Expression | SpreadElement | null>" } ] }, { "name": "Array", "slug": "array", "docs": "", "tags": [], "methods": [ { "name": "toString", "signature": "() => string", "parameters": [], "returns": "string", "tags": [], "docs": "Returns a string representation of an array.", "complexTypes": [], "slug": "tostring" }, { "name": "toLocaleString", "signature": "() => string", "parameters": [], "returns": "string", "tags": [], "docs": "Returns a string representation of an array. The elements are converted to string using their toLocalString methods.", "complexTypes": [], "slug": "tolocalestring" }, { "name": "pop", "signature": "() => T | undefined", "parameters": [], "returns": "T | undefined", "tags": [], "docs": "Removes the last element from an array and returns it.\r\nIf the array is empty, undefined is returned and the array is not modified.", "complexTypes": [ "T" ], "slug": "pop" }, { "name": "push", "signature": "(...items: T[]) => number", "parameters": [ { "name": "items", "docs": "New elements to add to the array.", "type": "T[]" } ], "returns": "number", "tags": [ { "name": "param", "text": "items New elements to add to the array." } ], "docs": "Appends new elements to the end of an array, and returns the new length of the array.", "complexTypes": [ "T" ], "slug": "push" }, { "name": "concat", "signature": "(...items: ConcatArray<T>[]) => T[]", "parameters": [ { "name": "items", "docs": "Additional arrays and/or items to add to the end of the array.", "type": "ConcatArray<T>[]" } ], "returns": "T[]", "tags": [ { "name": "param", "text": "items Additional arrays and/or items to add to the end of the array." } ], "docs": "Combines two or more arrays.\r\nThis method returns a new array without modifying any existing arrays.", "complexTypes": [ "T", "ConcatArray" ], "slug": "concat" }, { "name": "concat", "signature": "(...items: (T | ConcatArray<T>)[]) => T[]", "parameters": [ { "name": "items", "docs": "Additional arrays and/or items to add to the end of the array.", "type": "(T | ConcatArray<T>)[]" } ], "returns": "T[]", "tags": [ { "name": "param", "text": "items Additional arrays and/or items to add to the end of the array." } ], "docs": "Combines two or more arrays.\r\nThis method returns a new array without modifying any existing arrays.", "complexTypes": [ "T", "ConcatArray" ], "slug": "concat" }, { "name": "join", "signature": "(separator?: string | undefined) => string", "parameters": [ { "name": "separator", "docs": "A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.", "type": "string | undefined" } ], "returns": "string", "tags": [ { "name": "param", "text": "separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma." } ], "docs": "Adds all the elements of an array into a string, separated by the specified separator string.", "complexTypes": [], "slug": "join" }, { "name": "reverse", "signature": "() => T[]", "parameters": [], "returns": "T[]", "tags": [], "docs": "Reverses the elements in an array in place.\r\nThis method mutates the array and returns a reference to the same array.", "complexTypes": [ "T" ], "slug": "reverse" }, { "name": "shift", "signature": "() => T | undefined", "parameters": [], "returns": "T | undefined", "tags": [], "docs": "Removes the first element from an array and returns it.\r\nIf the array is empty, undefined is returned and the array is not modified.", "complexTypes": [ "T" ], "slug": "shift" }, { "name": "slice", "signature": "(start?: number | undefined, end?: number | undefined) => T[]", "parameters": [ { "name": "start", "docs": "The beginning index of the specified portion of the array.\r\nIf start is undefined, then the slice begins at index 0.", "type": "number | undefined" }, { "name": "end", "docs": "The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.\r\nIf end is undefined, then the slice extends to the end of the array.", "type": "number | undefined" } ], "returns": "T[]", "tags": [ { "name": "param", "text": "start The beginning index of the specified portion of the array.\r\nIf start is undefined, then the slice begins at index 0." }, { "name": "param", "text": "end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.\r\nIf end is undefined, then the slice extends to the end of the array." } ], "docs": "Returns a copy of a section of an array.\r\nFor both start and end, a negative index can be used to indicate an offset from the end of the array.\r\nFor example, -2 refers to the second to last element of the array.", "complexTypes": [ "T" ], "slug": "slice" }, { "name": "sort", "signature": "(compareFn?: ((a: T, b: T) => number) | undefined) => this", "parameters": [ { "name": "compareFn", "docs": "Function used to determine the order of the elements. It is expected to return\r\na negative value if first argument is less than second argument, zero if they're equal and a positive\r\nvalue otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r\n```ts\r\n[11,2,22,1].sort((a, b) => a - b)\r\n```", "type": "((a: T, b: T) => number) | undefined" } ], "returns": "this", "tags": [ { "name": "param", "text": "compareFn Function used to determine the order of the elements. It is expected to return\r\na negative value if first argument is less than second argument, zero if they're equal and a positive\r\nvalue otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r\n```ts\r\n[11,2,22,1].sort((a, b) => a - b)\r\n```" } ], "docs": "Sorts an array in place.\r\nThis method mutates the array and returns a reference to the same array.", "complexTypes": [ "T" ], "slug": "sort" }, { "name": "splice", "signature": "(start: number, deleteCount?: number | undefined) => T[]", "parameters": [ { "name": "start", "docs": "The zero-based location in the array from which to start removing elements.", "type": "number" }, { "name": "deleteCount", "docs": "The number of elements to remove.", "type": "number | undefined" } ], "returns": "T[]", "tags": [ { "name": "param", "text": "start The zero-based location in the array from which to start removing elements." }, { "name": "param", "text": "deleteCount The number of elements to remove." }, { "name": "returns", "text": "An array containing the elements that were deleted." } ], "docs": "Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.", "complexTypes": [ "T" ], "slug": "splice" }, { "name": "splice", "signature": "(start: number, deleteCount: number, ...items: T[]) => T[]", "parameters": [ { "name": "start", "docs": "The zero-based location in the array from which to start removing elements.", "type": "number" }, { "name": "deleteCount", "docs": "The number of elements to remove.", "type": "number" }, { "name": "items", "docs": "Elements to insert into the array in place of the deleted elements.", "type": "T[]" } ], "returns": "T[]", "tags": [ { "name": "param", "text": "start The zero-based location in the array from which to start removing elements." }, { "name": "param", "text": "deleteCount The number of elements to remove." }, { "name": "param", "text": "items Elements to insert into the array in place of the deleted elements." }, { "name": "returns", "text": "An array containing the elements that were deleted." } ], "docs": "Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.", "complexTypes": [ "T" ], "slug": "splice" }, { "name": "unshift", "signature": "(...items: T[]) => number", "parameters": [ { "name": "items", "docs": "Elements to insert at the start of the array.", "type": "T[]" } ], "returns": "number", "tags": [ { "name": "param", "text": "items Elements to insert at the start of the array." } ], "docs": "Inserts new elements at the start of an array, and returns the new length of the array.", "complexTypes": [ "T" ], "slug": "unshift" }, { "name": "indexOf", "signature": "(searchElement: T, fromIndex?: number | undefined) => number", "parameters": [ { "name": "searchElement", "docs": "The value to locate in the array.", "type": "T" }, { "name": "fromIndex", "docs": "The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.", "type": "number | undefined"