@codebolt/codeboltjs 2.0.2 → 2.0.4
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/Readme.md +47 -0
- package/{modules → dist}/agentlib/agent.js +63 -54
- package/{modules → dist}/agentlib/usermessage.js +3 -3
- package/{index.d.ts → dist/index.d.ts} +3 -0
- package/{index.js → dist/index.js} +2 -0
- package/dist/utils/editFile.d.ts +4 -0
- package/dist/utils/editFile.js +30 -0
- package/dist/utils.d.ts +5 -0
- package/{utils.js → dist/utils.js} +4 -4
- package/package.json +17 -8
- package/.codebolt/chat.json +0 -1
- package/.codebolt/debug.json +0 -1
- package/.codebolt/projectState.json +0 -127
- package/.codebolt/tasks.json +0 -1
- package/.codeboltconfig.yaml +0 -0
- package/.github/workflows/publish-to-npm.yml +0 -20
- package/bkp/toolBox.bkp.ts +0 -1162
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -127
- package/docs/assets/icons.js +0 -15
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -59
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1412
- package/docs/classes/_internal_.Agent.html +0 -318
- package/docs/classes/_internal_.AsyncResource.html +0 -44
- package/docs/classes/_internal_.Blob.html +0 -33
- package/docs/classes/_internal_.ClientRequest.html +0 -506
- package/docs/classes/_internal_.Codebolt.html +0 -315
- package/docs/classes/_internal_.CustomEventEmitter-1.html +0 -248
- package/docs/classes/_internal_.CustomEventEmitter.html +0 -248
- package/docs/classes/_internal_.Duplex.html +0 -690
- package/docs/classes/_internal_.EventEmitter-1.html +0 -254
- package/docs/classes/_internal_.EventEmitter.EventEmitterAsyncResource.html +0 -268
- package/docs/classes/_internal_.IncomingMessage.html +0 -661
- package/docs/classes/_internal_.KeyObject.html +0 -76
- package/docs/classes/_internal_.OutgoingMessage.html +0 -491
- package/docs/classes/_internal_.Readable.html +0 -551
- package/docs/classes/_internal_.ReadableBase.html +0 -551
- package/docs/classes/_internal_.Server-1.html +0 -416
- package/docs/classes/_internal_.Server-2.html +0 -326
- package/docs/classes/_internal_.Server-3.html +0 -353
- package/docs/classes/_internal_.Server.html +0 -390
- package/docs/classes/_internal_.ServerResponse.html +0 -569
- package/docs/classes/_internal_.Socket.html +0 -791
- package/docs/classes/_internal_.Stream.html +0 -256
- package/docs/classes/_internal_.TLSSocket.html +0 -947
- package/docs/classes/_internal_.URL.html +0 -140
- package/docs/classes/_internal_.URLSearchParams.html +0 -68
- package/docs/classes/_internal_.WebSocket-1.html +0 -297
- package/docs/classes/_internal_.WebSocket.Server.html +0 -261
- package/docs/classes/_internal_.Writable.html +0 -394
- package/docs/classes/_internal_.WritableBase.html +0 -394
- package/docs/classes/_internal_.X509Certificate.html +0 -144
- package/docs/classes/_internal_.internal-1.html +0 -256
- package/docs/classes/_internal_.internal.PassThrough.html +0 -686
- package/docs/classes/_internal_.internal.Transform.html +0 -693
- package/docs/enums/_internal_.logType.html +0 -4
- package/docs/functions/_internal_.WebSocket.createWebSocketStream.html +0 -1
- package/docs/functions/_internal_._node_stream_consumers_.arrayBuffer.html +0 -1
- package/docs/functions/_internal_._node_stream_consumers_.blob.html +0 -1
- package/docs/functions/_internal_._node_stream_consumers_.buffer.html +0 -1
- package/docs/functions/_internal_._node_stream_consumers_.json.html +0 -1
- package/docs/functions/_internal_._node_stream_consumers_.text.html +0 -1
- package/docs/functions/_internal_._node_stream_promises_.finished.html +0 -1
- package/docs/functions/_internal_._node_stream_promises_.pipeline.html +0 -1
- package/docs/functions/_internal_.internal.addAbortSignal.html +0 -17
- package/docs/functions/_internal_.internal.finished-1.html +0 -20
- package/docs/functions/_internal_.internal.finished.__promisify__.html +0 -1
- package/docs/functions/_internal_.internal.getDefaultHighWaterMark.html +0 -4
- package/docs/functions/_internal_.internal.isErrored.html +0 -3
- package/docs/functions/_internal_.internal.isReadable.html +0 -3
- package/docs/functions/_internal_.internal.pipeline-1.html +0 -24
- package/docs/functions/_internal_.internal.pipeline.__promisify__.html +0 -1
- package/docs/functions/_internal_.internal.setDefaultHighWaterMark.html +0 -4
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -12
- package/docs/interfaces/_internal_.AddToAgentStateResponse.html +0 -3
- package/docs/interfaces/_internal_.AddTokenResponse.html +0 -3
- package/docs/interfaces/_internal_.AddVectorItemResponse.html +0 -3
- package/docs/interfaces/_internal_.AddressInfo.html +0 -4
- package/docs/interfaces/_internal_.AgentOptions.html +0 -35
- package/docs/interfaces/_internal_.ApplicationState.html +0 -4
- package/docs/interfaces/_internal_.ArrayBufferView.html +0 -7
- package/docs/interfaces/_internal_.ArrayLike.html +0 -2
- package/docs/interfaces/_internal_.ArrayOptions.html +0 -7
- package/docs/interfaces/_internal_.AsymmetricKeyDetails.html +0 -15
- package/docs/interfaces/_internal_.AsyncGenerator.html +0 -5
- package/docs/interfaces/_internal_.AsyncGeneratorFunction.html +0 -12
- package/docs/interfaces/_internal_.AsyncIterable.html +0 -2
- package/docs/interfaces/_internal_.AsyncIterableIterator.html +0 -5
- package/docs/interfaces/_internal_.AsyncIterator.html +0 -4
- package/docs/interfaces/_internal_.AsyncResourceOptions.html +0 -12
- package/docs/interfaces/_internal_.BlobOptions.html +0 -8
- package/docs/interfaces/_internal_.Buffer.html +0 -760
- package/docs/interfaces/_internal_.BufferConstructor.html +0 -165
- package/docs/interfaces/_internal_.Certificate.html +0 -13
- package/docs/interfaces/_internal_.ChatMessage.html +0 -3
- package/docs/interfaces/_internal_.Choice.html +0 -5
- package/docs/interfaces/_internal_.CipherNameAndProtocol.html +0 -7
- package/docs/interfaces/_internal_.ClientRequestArgs.html +0 -28
- package/docs/interfaces/_internal_.CommandError.html +0 -3
- package/docs/interfaces/_internal_.CommonConnectionOptions.html +0 -29
- package/docs/interfaces/_internal_.ConnectOpts.html +0 -5
- package/docs/interfaces/_internal_.CreateFileResponse.html +0 -6
- package/docs/interfaces/_internal_.CreateFolderResponse.html +0 -6
- package/docs/interfaces/_internal_.CryptoKey.html +0 -26
- package/docs/interfaces/_internal_.DebugAddLogResponse.html +0 -4
- package/docs/interfaces/_internal_.DeleteFileResponse.html +0 -6
- package/docs/interfaces/_internal_.DeleteFolderResponse.html +0 -6
- package/docs/interfaces/_internal_.DetailedPeerCertificate.html +0 -53
- package/docs/interfaces/_internal_.Dict.html +0 -1
- package/docs/interfaces/_internal_.Disposable.html +0 -2
- package/docs/interfaces/_internal_.DropArgument.html +0 -7
- package/docs/interfaces/_internal_.DuplexOptions.html +0 -22
- package/docs/interfaces/_internal_.EphemeralKeyInfo.html +0 -7
- package/docs/interfaces/_internal_.ErrnoException.html +0 -8
- package/docs/interfaces/_internal_.Error.html +0 -4
- package/docs/interfaces/_internal_.EventEmitter-2.html +0 -130
- package/docs/interfaces/_internal_.EventEmitter.Abortable.html +0 -3
- package/docs/interfaces/_internal_.EventEmitter.EventEmitterAsyncResourceOptions.html +0 -19
- package/docs/interfaces/_internal_.EventEmitter.EventEmitterReferencingAsyncResource.html +0 -32
- package/docs/interfaces/_internal_.EventEmitterOptions.html +0 -3
- package/docs/interfaces/_internal_.ExtractTextResponse.html +0 -3
- package/docs/interfaces/_internal_.GetAgentStateResponse.html +0 -3
- package/docs/interfaces/_internal_.GetContentResponse.html +0 -3
- package/docs/interfaces/_internal_.GetMarkdownResponse.html +0 -3
- package/docs/interfaces/_internal_.GetMatcherListTreeResponse.html +0 -3
- package/docs/interfaces/_internal_.GetProjectPathResponse.html +0 -5
- package/docs/interfaces/_internal_.GetTokenResponse.html +0 -3
- package/docs/interfaces/_internal_.GetVectorResponse.html +0 -3
- package/docs/interfaces/_internal_.GoToPageResponse.html +0 -3
- package/docs/interfaces/_internal_.HtmlReceived.html +0 -3
- package/docs/interfaces/_internal_.IncomingHttpHeaders.html +0 -64
- package/docs/interfaces/_internal_.InformationEvent.html +0 -8
- package/docs/interfaces/_internal_.IpcSocketConnectOpts.html +0 -6
- package/docs/interfaces/_internal_.Iterable.html +0 -2
- package/docs/interfaces/_internal_.IterableIterator.html +0 -5
- package/docs/interfaces/_internal_.Iterator.html +0 -4
- package/docs/interfaces/_internal_.IteratorReturnResult.html +0 -3
- package/docs/interfaces/_internal_.IteratorYieldResult.html +0 -3
- package/docs/interfaces/_internal_.JsonWebKey.html +0 -14
- package/docs/interfaces/_internal_.JwkKeyExportOptions.html +0 -2
- package/docs/interfaces/_internal_.KeyAlgorithm.html +0 -2
- package/docs/interfaces/_internal_.KeyExportOptions.html +0 -5
- package/docs/interfaces/_internal_.KeyObject-1.html +0 -5
- package/docs/interfaces/_internal_.LLMResponse.html +0 -4
- package/docs/interfaces/_internal_.ListenOptions.html +0 -13
- package/docs/interfaces/_internal_.LookupAddress.html +0 -6
- package/docs/interfaces/_internal_.LookupOptions.html +0 -27
- package/docs/interfaces/_internal_.MatchProblemResponse.html +0 -3
- package/docs/interfaces/_internal_.MemoryGetResponse.html +0 -5
- package/docs/interfaces/_internal_.MemorySetResponse.html +0 -5
- package/docs/interfaces/_internal_.Message.html +0 -8
- package/docs/interfaces/_internal_.MessageContent.html +0 -3
- package/docs/interfaces/_internal_.Object.html +0 -18
- package/docs/interfaces/_internal_.OnReadOpts.html +0 -6
- package/docs/interfaces/_internal_.OpenDebugBrowserResponse.html +0 -4
- package/docs/interfaces/_internal_.OutgoingHttpHeaders.html +0 -80
- package/docs/interfaces/_internal_.PeerCertificate.html +0 -50
- package/docs/interfaces/_internal_.PromiseLike.html +0 -6
- package/docs/interfaces/_internal_.PxfObject.html +0 -5
- package/docs/interfaces/_internal_.QueryVectorItemResponse.html +0 -3
- package/docs/interfaces/_internal_.QueuingStrategy.html +0 -3
- package/docs/interfaces/_internal_.QueuingStrategySize.html +0 -1
- package/docs/interfaces/_internal_.ReadFileResponse.html +0 -7
- package/docs/interfaces/_internal_.ReadOnlyDict.html +0 -1
- package/docs/interfaces/_internal_.ReadWriteStream.html +0 -144
- package/docs/interfaces/_internal_.ReadableByteStreamController.html +0 -6
- package/docs/interfaces/_internal_.ReadableByteStreamControllerCallback.html +0 -1
- package/docs/interfaces/_internal_.ReadableOptions.html +0 -11
- package/docs/interfaces/_internal_.ReadableStream-1.html +0 -141
- package/docs/interfaces/_internal_.ReadableStream.html +0 -10
- package/docs/interfaces/_internal_.ReadableStreamBYOBReader.html +0 -5
- package/docs/interfaces/_internal_.ReadableStreamDefaultController.html +0 -5
- package/docs/interfaces/_internal_.ReadableStreamDefaultReadDoneResult.html +0 -3
- package/docs/interfaces/_internal_.ReadableStreamDefaultReadValueResult.html +0 -3
- package/docs/interfaces/_internal_.ReadableStreamDefaultReader.html +0 -5
- package/docs/interfaces/_internal_.ReadableStreamErrorCallback.html +0 -1
- package/docs/interfaces/_internal_.ReadableStreamGenericReader.html +0 -3
- package/docs/interfaces/_internal_.ReadableStreamReadDoneResult.html +0 -3
- package/docs/interfaces/_internal_.ReadableStreamReadValueResult.html +0 -3
- package/docs/interfaces/_internal_.ReadableWritablePair.html +0 -9
- package/docs/interfaces/_internal_.SecureContext.html +0 -2
- package/docs/interfaces/_internal_.SecureContextOptions.html +0 -121
- package/docs/interfaces/_internal_.Selection.html +0 -6
- package/docs/interfaces/_internal_.ServerOptions.html +0 -64
- package/docs/interfaces/_internal_.ServerOpts.html +0 -25
- package/docs/interfaces/_internal_.SharedArrayBuffer.html +0 -7
- package/docs/interfaces/_internal_.SharedArrayBufferConstructor.html +0 -3
- package/docs/interfaces/_internal_.SocketConstructorOpts.html +0 -6
- package/docs/interfaces/_internal_.StaticEventEmitterOptions.html +0 -15
- package/docs/interfaces/_internal_.StreamOptions.html +0 -9
- package/docs/interfaces/_internal_.StreamPipeOptions.html +0 -37
- package/docs/interfaces/_internal_.TLSSocketOptions.html +0 -160
- package/docs/interfaces/_internal_.TcpSocketConnectOpts.html +0 -19
- package/docs/interfaces/_internal_.TerminalInterruptResponse.html +0 -3
- package/docs/interfaces/_internal_.TlsOptions.html +0 -197
- package/docs/interfaces/_internal_.UnderlyingByteSource.html +0 -6
- package/docs/interfaces/_internal_.UnderlyingSink.html +0 -6
- package/docs/interfaces/_internal_.UnderlyingSinkAbortCallback.html +0 -1
- package/docs/interfaces/_internal_.UnderlyingSinkCloseCallback.html +0 -1
- package/docs/interfaces/_internal_.UnderlyingSinkStartCallback.html +0 -1
- package/docs/interfaces/_internal_.UnderlyingSinkWriteCallback.html +0 -1
- package/docs/interfaces/_internal_.UnderlyingSource.html +0 -5
- package/docs/interfaces/_internal_.UnderlyingSourceCancelCallback.html +0 -1
- package/docs/interfaces/_internal_.UnderlyingSourcePullCallback.html +0 -1
- package/docs/interfaces/_internal_.UnderlyingSourceStartCallback.html +0 -1
- package/docs/interfaces/_internal_.UpdateFileResponse.html +0 -6
- package/docs/interfaces/_internal_.UrlResponse.html +0 -3
- package/docs/interfaces/_internal_.Usage-1.html +0 -4
- package/docs/interfaces/_internal_.Usage.html +0 -4
- package/docs/interfaces/_internal_.UserMessage.html +0 -3
- package/docs/interfaces/_internal_.UserRequest.html +0 -7
- package/docs/interfaces/_internal_.WebSocket.AddressInfo.html +0 -4
- package/docs/interfaces/_internal_.WebSocket.ClientOptions.html +0 -138
- package/docs/interfaces/_internal_.WebSocket.CloseEvent.html +0 -6
- package/docs/interfaces/_internal_.WebSocket.ErrorEvent.html +0 -5
- package/docs/interfaces/_internal_.WebSocket.Event.html +0 -3
- package/docs/interfaces/_internal_.WebSocket.EventListenerOptions.html +0 -2
- package/docs/interfaces/_internal_.WebSocket.MessageEvent.html +0 -4
- package/docs/interfaces/_internal_.WebSocket.PerMessageDeflateOptions.html +0 -9
- package/docs/interfaces/_internal_.WebSocket.ServerOptions.html +0 -14
- package/docs/interfaces/_internal_.WebSocket.WebSocket.html +0 -172
- package/docs/interfaces/_internal_.WebSocket.WebSocketServer.html +0 -144
- package/docs/interfaces/_internal_.WebSocketAlias.html +0 -172
- package/docs/interfaces/_internal_.WritableOptions.html +0 -14
- package/docs/interfaces/_internal_.WritableStream-1.html +0 -8
- package/docs/interfaces/_internal_.WritableStream.html +0 -133
- package/docs/interfaces/_internal_.WritableStreamDefaultController.html +0 -6
- package/docs/interfaces/_internal_.WritableStreamDefaultWriter.html +0 -12
- package/docs/interfaces/_internal_.X509CheckOptions.html +0 -16
- package/docs/interfaces/_internal_.ZlibOptions.html +0 -21
- package/docs/interfaces/_internal_.getMatchDetail.html +0 -3
- package/docs/interfaces/_internal_.internal.FinishedOptions.html +0 -6
- package/docs/interfaces/_internal_.internal.Pipe.html +0 -5
- package/docs/interfaces/_internal_.internal.PipelineOptions.html +0 -3
- package/docs/interfaces/_internal_.internal.TransformOptions.html +0 -24
- package/docs/modules/_internal_.EventEmitter.html +0 -6
- package/docs/modules/_internal_.WebSocket.html +0 -21
- package/docs/modules/_internal_._node_stream_consumers_.html +0 -6
- package/docs/modules/_internal_._node_stream_promises_.html +0 -3
- package/docs/modules/_internal_.html +0 -228
- package/docs/modules/_internal_.internal.finished.html +0 -2
- package/docs/modules/_internal_.internal.html +0 -36
- package/docs/modules/_internal_.internal.pipeline.html +0 -2
- package/docs/modules.html +0 -3
- package/docs/types/_internal_.AnyRest.html +0 -1
- package/docs/types/_internal_.Args.html +0 -1
- package/docs/types/_internal_.ArrayBufferLike.html +0 -1
- package/docs/types/_internal_.ArrayBufferView-1.html +0 -1
- package/docs/types/_internal_.BinaryLike.html +0 -1
- package/docs/types/_internal_.BufferEncoding.html +0 -1
- package/docs/types/_internal_.BufferLike.html +0 -1
- package/docs/types/_internal_.ComposeFnParam.html +0 -1
- package/docs/types/_internal_.DefaultEventMap.html +0 -1
- package/docs/types/_internal_.EventMap.html +0 -1
- package/docs/types/_internal_.InstanceType.html +0 -2
- package/docs/types/_internal_.IteratorResult.html +0 -1
- package/docs/types/_internal_.Key.html +0 -1
- package/docs/types/_internal_.Key2.html +0 -1
- package/docs/types/_internal_.KeyFormat.html +0 -1
- package/docs/types/_internal_.KeyObjectType.html +0 -1
- package/docs/types/_internal_.KeyType-1.html +0 -1
- package/docs/types/_internal_.KeyType.html +0 -1
- package/docs/types/_internal_.KeyUsage.html +0 -1
- package/docs/types/_internal_.Listener.html +0 -1
- package/docs/types/_internal_.LookupFunction.html +0 -1
- package/docs/types/_internal_.OutgoingHttpHeader.html +0 -1
- package/docs/types/_internal_.Partial.html +0 -2
- package/docs/types/_internal_.Pick.html +0 -2
- package/docs/types/_internal_.PropertyKey.html +0 -1
- package/docs/types/_internal_.ReadableStreamController.html +0 -1
- package/docs/types/_internal_.ReadableStreamDefaultReadResult.html +0 -1
- package/docs/types/_internal_.ReadableStreamReadResult.html +0 -1
- package/docs/types/_internal_.Record.html +0 -2
- package/docs/types/_internal_.RequestListener.html +0 -1
- package/docs/types/_internal_.SecureVersion.html +0 -1
- package/docs/types/_internal_.ServerOptions-1.html +0 -1
- package/docs/types/_internal_.SocketConnectOpts.html +0 -1
- package/docs/types/_internal_.SocketReadyState.html +0 -1
- package/docs/types/_internal_.TypedArray.html +0 -1
- package/docs/types/_internal_.WebSocket.CertMeta.html +0 -2
- package/docs/types/_internal_.WebSocket.Data.html +0 -2
- package/docs/types/_internal_.WebSocket.RawData.html +0 -2
- package/docs/types/_internal_.WebSocket.VerifyClientCallbackAsync.html +0 -4
- package/docs/types/_internal_.WebSocket.VerifyClientCallbackSync.html +0 -4
- package/docs/types/_internal_.WithImplicitCoercion.html +0 -1
- package/docs/types/_internal_.internal.PipelineCallback.html +0 -1
- package/docs/types/_internal_.internal.PipelineDestination.html +0 -1
- package/docs/types/_internal_.internal.PipelineDestinationIterableFunction.html +0 -1
- package/docs/types/_internal_.internal.PipelineDestinationPromiseFunction.html +0 -1
- package/docs/types/_internal_.internal.PipelinePromise.html +0 -1
- package/docs/types/_internal_.internal.PipelineSource.html +0 -1
- package/docs/types/_internal_.internal.PipelineSourceFunction.html +0 -1
- package/docs/types/_internal_.internal.PipelineTransform.html +0 -1
- package/docs/types/_internal_.internal.PipelineTransformSource.html +0 -1
- package/docs/types/_internal_.internal.TransformCallback.html +0 -1
- package/docs/variables/_internal_.Buffer-1.html +0 -1
- package/docs/variables/_internal_.Error-1.html +0 -1
- package/docs/variables/_internal_.Object-1.html +0 -2
- package/docs/variables/_internal_.ReadableByteStreamController-1.html +0 -1
- package/docs/variables/_internal_.ReadableStream-2.html +0 -1
- package/docs/variables/_internal_.ReadableStreamBYOBReader-1.html +0 -1
- package/docs/variables/_internal_.ReadableStreamDefaultController-1.html +0 -1
- package/docs/variables/_internal_.ReadableStreamDefaultReader-1.html +0 -1
- package/docs/variables/_internal_.SharedArrayBuffer-1.html +0 -1
- package/docs/variables/_internal_.WebSocket.WebSocket-1.html +0 -1
- package/docs/variables/_internal_.WebSocket.WebSocketServer-1.html +0 -1
- package/docs/variables/_internal_.WebSocketAlias-1.html +0 -1
- package/docs/variables/_internal_.WritableStream-2.html +0 -1
- package/docs/variables/_internal_.WritableStreamDefaultController-1.html +0 -1
- package/docs/variables/_internal_.WritableStreamDefaultWriter-1.html +0 -1
- package/docs/variables/_internal_.internal.consumers.html +0 -1
- package/docs/variables/_internal_.internal.promises.html +0 -1
- package/docs/variables/default.html +0 -1
- package/script/gen.js +0 -27
- package/src/index.ts +0 -107
- package/src/modules/agent.ts +0 -120
- package/src/modules/agentlib/agent.ts +0 -406
- package/src/modules/agentlib/systemprompt.ts +0 -55
- package/src/modules/agentlib/taskInstruction.ts +0 -105
- package/src/modules/agentlib/usermessage.ts +0 -188
- package/src/modules/browser.ts +0 -352
- package/src/modules/chat.ts +0 -229
- package/src/modules/codeparsers.ts +0 -28
- package/src/modules/codeutils.ts +0 -182
- package/src/modules/crawler.ts +0 -121
- package/src/modules/dbmemory.ts +0 -52
- package/src/modules/debug.ts +0 -68
- package/src/modules/docutils.ts +0 -18
- package/src/modules/fs.ts +0 -263
- package/src/modules/git.ts +0 -237
- package/src/modules/history.ts +0 -82
- package/src/modules/knowledge.ts +0 -5
- package/src/modules/llm.ts +0 -36
- package/src/modules/outputparsers.ts +0 -30
- package/src/modules/project.ts +0 -68
- package/src/modules/rag.ts +0 -27
- package/src/modules/search.ts +0 -32
- package/src/modules/state.ts +0 -115
- package/src/modules/task.ts +0 -73
- package/src/modules/terminal.ts +0 -113
- package/src/modules/tokenizer.ts +0 -56
- package/src/modules/toolBox.ts +0 -1384
- package/src/modules/tools.ts +0 -254
- package/src/modules/vectordb.ts +0 -102
- package/src/modules/websocket.ts +0 -97
- package/src/utils.ts +0 -5
- package/tests/chat.test.js +0 -0
- package/tests/fs.test.js +0 -89
- package/tests/index.test.js +0 -4
- package/tsconfig.json +0 -122
- package/utils.d.ts +0 -5
- package/webpack.config.js +0 -25
- /package/{modules → dist}/agentlib/agent.d.ts +0 -0
- /package/{modules → dist}/agentlib/systemprompt.d.ts +0 -0
- /package/{modules → dist}/agentlib/systemprompt.js +0 -0
- /package/{modules → dist}/agentlib/taskInstruction.d.ts +0 -0
- /package/{modules → dist}/agentlib/taskInstruction.js +0 -0
- /package/{modules → dist}/agentlib/usermessage.d.ts +0 -0
- /package/{modules → dist/modules}/agent.d.ts +0 -0
- /package/{modules → dist/modules}/agent.js +0 -0
- /package/{modules → dist/modules}/browser.d.ts +0 -0
- /package/{modules → dist/modules}/browser.js +0 -0
- /package/{modules → dist/modules}/chat.d.ts +0 -0
- /package/{modules → dist/modules}/chat.js +0 -0
- /package/{modules → dist/modules}/codeparsers.d.ts +0 -0
- /package/{modules → dist/modules}/codeparsers.js +0 -0
- /package/{modules → dist/modules}/codeutils.d.ts +0 -0
- /package/{modules → dist/modules}/codeutils.js +0 -0
- /package/{modules → dist/modules}/crawler.d.ts +0 -0
- /package/{modules → dist/modules}/crawler.js +0 -0
- /package/{modules → dist/modules}/dbmemory.d.ts +0 -0
- /package/{modules → dist/modules}/dbmemory.js +0 -0
- /package/{modules → dist/modules}/debug.d.ts +0 -0
- /package/{modules → dist/modules}/debug.js +0 -0
- /package/{modules → dist/modules}/docutils.d.ts +0 -0
- /package/{modules → dist/modules}/docutils.js +0 -0
- /package/{modules → dist/modules}/fs.d.ts +0 -0
- /package/{modules → dist/modules}/fs.js +0 -0
- /package/{modules → dist/modules}/git.d.ts +0 -0
- /package/{modules → dist/modules}/git.js +0 -0
- /package/{modules → dist/modules}/history.d.ts +0 -0
- /package/{modules → dist/modules}/history.js +0 -0
- /package/{modules → dist/modules}/knowledge.d.ts +0 -0
- /package/{modules → dist/modules}/knowledge.js +0 -0
- /package/{modules → dist/modules}/llm.d.ts +0 -0
- /package/{modules → dist/modules}/llm.js +0 -0
- /package/{modules → dist/modules}/outputparsers.d.ts +0 -0
- /package/{modules → dist/modules}/outputparsers.js +0 -0
- /package/{modules → dist/modules}/project.d.ts +0 -0
- /package/{modules → dist/modules}/project.js +0 -0
- /package/{modules → dist/modules}/rag.d.ts +0 -0
- /package/{modules → dist/modules}/rag.js +0 -0
- /package/{modules → dist/modules}/search.d.ts +0 -0
- /package/{modules → dist/modules}/search.js +0 -0
- /package/{modules → dist/modules}/state.d.ts +0 -0
- /package/{modules → dist/modules}/state.js +0 -0
- /package/{modules → dist/modules}/task.d.ts +0 -0
- /package/{modules → dist/modules}/task.js +0 -0
- /package/{modules → dist/modules}/terminal.d.ts +0 -0
- /package/{modules → dist/modules}/terminal.js +0 -0
- /package/{modules → dist/modules}/tokenizer.d.ts +0 -0
- /package/{modules → dist/modules}/tokenizer.js +0 -0
- /package/{modules → dist/modules}/toolBox.d.ts +0 -0
- /package/{modules → dist/modules}/toolBox.js +0 -0
- /package/{modules → dist/modules}/tools.d.ts +0 -0
- /package/{modules → dist/modules}/tools.js +0 -0
- /package/{modules → dist/modules}/vectordb.d.ts +0 -0
- /package/{modules → dist/modules}/vectordb.js +0 -0
- /package/{modules → dist/modules}/websocket.d.ts +0 -0
- /package/{modules → dist/modules}/websocket.js +0 -0
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BufferConstructor | @codebolt/codeboltjs</title><meta name="description" content="Documentation for @codebolt/codeboltjs"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@codebolt/codeboltjs</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@codebolt/codeboltjs</a></li><li><a href="../modules/_internal_.html"><internal></a></li><li><a href="_internal_.BufferConstructor.html">BufferConstructor</a></li></ul><h1>Interface BufferConstructor</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Raw data is stored in instances of the Buffer class.
|
|
2
|
-
A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
|
|
3
|
-
Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">BufferConstructor</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-constructor-signature" href="_internal_.BufferConstructor.html#constructor.new_BufferConstructor">new BufferConstructor</a><span class="tsd-signature-keyword">new </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">str</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-constructor-signature" href="_internal_.BufferConstructor.html#constructor.new_BufferConstructor-1">new BufferConstructor</a><span class="tsd-signature-keyword">new </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-constructor-signature" href="_internal_.BufferConstructor.html#constructor.new_BufferConstructor-2">new BufferConstructor</a><span class="tsd-signature-keyword">new </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">array</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-constructor-signature" href="_internal_.BufferConstructor.html#constructor.new_BufferConstructor-3">new BufferConstructor</a><span class="tsd-signature-keyword">new </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">arrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-constructor-signature" href="_internal_.BufferConstructor.html#constructor.new_BufferConstructor-4">new BufferConstructor</a><span class="tsd-signature-keyword">new </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">array</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-constructor-signature" href="_internal_.BufferConstructor.html#constructor.new_BufferConstructor-5">new BufferConstructor</a><span class="tsd-signature-keyword">new </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">buffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.BufferConstructor.html#poolSize">poolSize</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#alloc.alloc-1">alloc</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span>, <span class="tsd-kind-parameter">fill</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#allocUnsafe.allocUnsafe-1">allocUnsafe</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#allocUnsafeSlow.allocUnsafeSlow-1">allocUnsafeSlow</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#byteLength.byteLength-1">byteLength</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">string</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#compare.compare-1">compare</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">buf1</span>, <span class="tsd-kind-parameter">buf2</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">-1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#concat.concat-1">concat</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">list</span>, <span class="tsd-kind-parameter">totalLength</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#copyBytesFrom.copyBytesFrom-1">copyBytesFrom</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">view</span>, <span class="tsd-kind-parameter">offset</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">length</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#from.from-1">from</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">arrayBuffer</span>, <span class="tsd-kind-parameter">byteOffset</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">length</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#from.from-2">from</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#from.from-3">from</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#from.from-4">from</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">str</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#isBuffer.isBuffer-1">isBuffer</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-keyword"> is </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#isEncoding.isEncoding-1">isEncoding</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-keyword"> is </span><a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="_internal_.BufferConstructor.html#of.of-1">of</a><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">items</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:256</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="_internal_.BufferConstructor.html#constructor" class="tsd-index-link deprecated tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
5
|
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_internal_.BufferConstructor.html#poolSize" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pool<wbr/>Size</span></a>
|
|
6
|
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="_internal_.BufferConstructor.html#alloc" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>alloc</span></a>
|
|
7
|
-
<a href="_internal_.BufferConstructor.html#allocUnsafe" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>alloc<wbr/>Unsafe</span></a>
|
|
8
|
-
<a href="_internal_.BufferConstructor.html#allocUnsafeSlow" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>alloc<wbr/>Unsafe<wbr/>Slow</span></a>
|
|
9
|
-
<a href="_internal_.BufferConstructor.html#byteLength" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>byte<wbr/>Length</span></a>
|
|
10
|
-
<a href="_internal_.BufferConstructor.html#compare" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>compare</span></a>
|
|
11
|
-
<a href="_internal_.BufferConstructor.html#concat" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>concat</span></a>
|
|
12
|
-
<a href="_internal_.BufferConstructor.html#copyBytesFrom" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>copy<wbr/>Bytes<wbr/>From</span></a>
|
|
13
|
-
<a href="_internal_.BufferConstructor.html#from" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>from</span></a>
|
|
14
|
-
<a href="_internal_.BufferConstructor.html#isBuffer" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Buffer</span></a>
|
|
15
|
-
<a href="_internal_.BufferConstructor.html#isEncoding" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Encoding</span></a>
|
|
16
|
-
<a href="_internal_.BufferConstructor.html#of" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>of</span></a>
|
|
17
|
-
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="deprecated">constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BufferConstructor" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Buffer<wbr/>Constructor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">str</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#constructor.new_BufferConstructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new buffer containing the given {str}.</p>
|
|
18
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">str</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>String to store in buffer.</p>
|
|
19
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span><div class="tsd-comment tsd-typography"><p>encoding to use, optional. Default is 'utf8'</p>
|
|
20
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>since v10.0.0 - Use <code>Buffer.from(string[, encoding])</code> instead.</p>
|
|
21
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:264</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BufferConstructor-1" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Buffer<wbr/>Constructor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#constructor.new_BufferConstructor-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new buffer of {size} octets.</p>
|
|
22
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">size</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>count of octets to allocate.</p>
|
|
23
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>since v10.0.0 - Use <code>Buffer.alloc()</code> instead (also see <code>Buffer.allocUnsafe()</code>).</p>
|
|
24
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:271</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BufferConstructor-2" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Buffer<wbr/>Constructor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">array</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#constructor.new_BufferConstructor-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new buffer containing the given {array} of octets.</p>
|
|
25
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">array</span>: <span class="tsd-signature-type">Uint8Array</span></span><div class="tsd-comment tsd-typography"><p>The octets to store.</p>
|
|
26
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>since v10.0.0 - Use <code>Buffer.from(array)</code> instead.</p>
|
|
27
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:278</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BufferConstructor-3" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Buffer<wbr/>Constructor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">arrayBuffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#constructor.new_BufferConstructor-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Produces a Buffer backed by the same allocated memory as
|
|
28
|
-
the given {ArrayBuffer}/{SharedArrayBuffer}.</p>
|
|
29
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">arrayBuffer</span>: <span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.SharedArrayBuffer.html" class="tsd-signature-type tsd-kind-interface">SharedArrayBuffer</a></span><div class="tsd-comment tsd-typography"><p>The ArrayBuffer with which to share memory.</p>
|
|
30
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>since v10.0.0 - Use <code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code> instead.</p>
|
|
31
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:286</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BufferConstructor-4" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Buffer<wbr/>Constructor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">array</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#constructor.new_BufferConstructor-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new buffer containing the given {array} of octets.</p>
|
|
32
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">array</span>: <span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>The octets to store.</p>
|
|
33
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>since v10.0.0 - Use <code>Buffer.from(array)</code> instead.</p>
|
|
34
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:293</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BufferConstructor-5" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Buffer<wbr/>Constructor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">buffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#constructor.new_BufferConstructor-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Copies the passed {buffer} data onto a new {Buffer} instance.</p>
|
|
35
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">buffer</span>: <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></span><div class="tsd-comment tsd-typography"><p>The buffer to copy.</p>
|
|
36
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>since v10.0.0 - Use <code>Buffer.from(buffer)</code> instead.</p>
|
|
37
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:300</li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="poolSize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>pool<wbr/>Size</span><a href="#poolSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">pool<wbr/>Size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>This is the size (in bytes) of pre-allocated internal <code>Buffer</code> instances used
|
|
38
|
-
for pooling. This value may be modified.</p>
|
|
39
|
-
</div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.11.3</p>
|
|
40
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:630</li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="alloc" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>alloc</span><a href="#alloc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="alloc.alloc-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">alloc</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span>, <span class="tsd-kind-parameter">fill</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#alloc.alloc-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>fill</code> is <code>undefined</code>, the<code>Buffer</code> will be zero-filled.</p>
|
|
41
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">5</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: <Buffer 00 00 00 00 00></span>
|
|
42
|
-
</code><button>Copy</button></pre>
|
|
43
|
-
<p>If <code>size</code> is larger than constants.MAX_LENGTH or smaller than 0, <code>ERR_OUT_OF_RANGE</code> is thrown.</p>
|
|
44
|
-
<p>If <code>fill</code> is specified, the allocated <code>Buffer</code> will be initialized by calling <code>buf.fill(fill)</code>.</p>
|
|
45
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">5</span><span class="hl-1">, </span><span class="hl-2">'a'</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: <Buffer 61 61 61 61 61></span>
|
|
46
|
-
</code><button>Copy</button></pre>
|
|
47
|
-
<p>If both <code>fill</code> and <code>encoding</code> are specified, the allocated <code>Buffer</code> will be
|
|
48
|
-
initialized by calling <code>buf.fill(fill, encoding)</code>.</p>
|
|
49
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">11</span><span class="hl-1">, </span><span class="hl-2">'aGVsbG8gd29ybGQ='</span><span class="hl-1">, </span><span class="hl-2">'base64'</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64></span>
|
|
50
|
-
</code><button>Copy</button></pre>
|
|
51
|
-
<p>Calling <code>Buffer.alloc()</code> can be measurably slower than the alternative <code>Buffer.allocUnsafe()</code> but ensures that the newly created <code>Buffer</code> instance
|
|
52
|
-
contents will never contain sensitive data from previous allocations, including
|
|
53
|
-
data that might not have been allocated for <code>Buffer</code>s.</p>
|
|
54
|
-
<p>A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</p>
|
|
55
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">size</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The desired length of the new <code>Buffer</code>.</p>
|
|
56
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">fill</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Uint8Array</span></span><div class="tsd-comment tsd-typography"><p>A value to pre-fill the new <code>Buffer</code> with.</p>
|
|
57
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span><div class="tsd-comment tsd-typography"><p>If <code>fill</code> is a string, this is its encoding.</p>
|
|
58
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v5.10.0</p>
|
|
59
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:543</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="allocUnsafe" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>alloc<wbr/>Unsafe</span><a href="#allocUnsafe" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="allocUnsafe.allocUnsafe-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">alloc<wbr/>Unsafe</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#allocUnsafe.allocUnsafe-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>size</code> is larger than constants.MAX_LENGTH or smaller than 0, <code>ERR_OUT_OF_RANGE</code> is thrown.</p>
|
|
60
|
-
<p>The underlying memory for <code>Buffer</code> instances created in this way is <em>not</em>
|
|
61
|
-
<em>initialized</em>. The contents of the newly created <code>Buffer</code> are unknown and <em>may contain sensitive data</em>. Use <code>Buffer.alloc()</code> instead to initialize<code>Buffer</code> instances with zeroes.</p>
|
|
62
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">allocUnsafe</span><span class="hl-1">(</span><span class="hl-9">10</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32></span><br/><br/><span class="hl-7">buf</span><span class="hl-1">.</span><span class="hl-0">fill</span><span class="hl-1">(</span><span class="hl-9">0</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: <Buffer 00 00 00 00 00 00 00 00 00 00></span>
|
|
63
|
-
</code><button>Copy</button></pre>
|
|
64
|
-
<p>A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</p>
|
|
65
|
-
<p>The <code>Buffer</code> module pre-allocates an internal <code>Buffer</code> instance of
|
|
66
|
-
size <code>Buffer.poolSize</code> that is used as a pool for the fast allocation of new <code>Buffer</code> instances created using <code>Buffer.allocUnsafe()</code>, <code>Buffer.from(array)</code>,
|
|
67
|
-
and <code>Buffer.concat()</code> only when <code>size</code> is less than <code>Buffer.poolSize >>> 1</code> (floor of <code>Buffer.poolSize</code> divided by two).</p>
|
|
68
|
-
<p>Use of this pre-allocated internal memory pool is a key difference between
|
|
69
|
-
calling <code>Buffer.alloc(size, fill)</code> vs. <code>Buffer.allocUnsafe(size).fill(fill)</code>.
|
|
70
|
-
Specifically, <code>Buffer.alloc(size, fill)</code> will <em>never</em> use the internal <code>Buffer</code>pool, while <code>Buffer.allocUnsafe(size).fill(fill)</code><em>will</em> use the internal<code>Buffer</code> pool if <code>size</code> is less
|
|
71
|
-
than or equal to half <code>Buffer.poolSize</code>. The
|
|
72
|
-
difference is subtle but can be important when an application requires the
|
|
73
|
-
additional performance that <code>Buffer.allocUnsafe()</code> provides.</p>
|
|
74
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">size</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The desired length of the new <code>Buffer</code>.</p>
|
|
75
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v5.10.0</p>
|
|
76
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:579</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="allocUnsafeSlow" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>alloc<wbr/>Unsafe<wbr/>Slow</span><a href="#allocUnsafeSlow" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="allocUnsafeSlow.allocUnsafeSlow-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">alloc<wbr/>Unsafe<wbr/>Slow</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#allocUnsafeSlow.allocUnsafeSlow-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>size</code> is larger than constants.MAX_LENGTH or smaller than 0, <code>ERR_OUT_OF_RANGE</code> is thrown. A zero-length <code>Buffer</code> is created if
|
|
77
|
-
<code>size</code> is 0.</p>
|
|
78
|
-
<p>The underlying memory for <code>Buffer</code> instances created in this way is <em>not</em>
|
|
79
|
-
<em>initialized</em>. The contents of the newly created <code>Buffer</code> are unknown and <em>may contain sensitive data</em>. Use <code>buf.fill(0)</code> to initialize
|
|
80
|
-
such <code>Buffer</code> instances with zeroes.</p>
|
|
81
|
-
<p>When using <code>Buffer.allocUnsafe()</code> to allocate new <code>Buffer</code> instances,
|
|
82
|
-
allocations under 4 KiB are sliced from a single pre-allocated <code>Buffer</code>. This
|
|
83
|
-
allows applications to avoid the garbage collection overhead of creating many
|
|
84
|
-
individually allocated <code>Buffer</code> instances. This approach improves both
|
|
85
|
-
performance and memory usage by eliminating the need to track and clean up as
|
|
86
|
-
many individual <code>ArrayBuffer</code> objects.</p>
|
|
87
|
-
<p>However, in the case where a developer may need to retain a small chunk of
|
|
88
|
-
memory from a pool for an indeterminate amount of time, it may be appropriate
|
|
89
|
-
to create an un-pooled <code>Buffer</code> instance using <code>Buffer.allocUnsafeSlow()</code> and
|
|
90
|
-
then copying out the relevant bits.</p>
|
|
91
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">// Need to keep around a few small chunks of memory.</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">store</span><span class="hl-1"> = [];</span><br/><br/><span class="hl-7">socket</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">'readable'</span><span class="hl-1">, () </span><span class="hl-3">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-7">data</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">while</span><span class="hl-1"> (</span><span class="hl-3">null</span><span class="hl-1"> !== (</span><span class="hl-7">data</span><span class="hl-1"> = </span><span class="hl-7">readable</span><span class="hl-1">.</span><span class="hl-0">read</span><span class="hl-1">())) {</span><br/><span class="hl-1"> </span><span class="hl-5">// Allocate for retained data.</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">sb</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">allocUnsafeSlow</span><span class="hl-1">(</span><span class="hl-9">10</span><span class="hl-1">);</span><br/><br/><span class="hl-1"> </span><span class="hl-5">// Copy the data into the new allocation.</span><br/><span class="hl-1"> </span><span class="hl-7">data</span><span class="hl-1">.</span><span class="hl-0">copy</span><span class="hl-1">(</span><span class="hl-7">sb</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">10</span><span class="hl-1">);</span><br/><br/><span class="hl-1"> </span><span class="hl-7">store</span><span class="hl-1">.</span><span class="hl-0">push</span><span class="hl-1">(</span><span class="hl-7">sb</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
|
|
92
|
-
</code><button>Copy</button></pre>
|
|
93
|
-
<p>A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</p>
|
|
94
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">size</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The desired length of the new <code>Buffer</code>.</p>
|
|
95
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v5.12.0</p>
|
|
96
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:624</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="byteLength" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>byte<wbr/>Length</span><a href="#byteLength" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="byteLength.byteLength-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">byte<wbr/>Length</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">string</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#byteLength.byteLength-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the byte length of a string when encoded using <code>encoding</code>.
|
|
97
|
-
This is not the same as <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length"><code>String.prototype.length</code></a>, which does not account
|
|
98
|
-
for the encoding that is used to convert the string into bytes.</p>
|
|
99
|
-
<p>For <code>'base64'</code>, <code>'base64url'</code>, and <code>'hex'</code>, this function assumes valid input.
|
|
100
|
-
For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
|
|
101
|
-
return value might be greater than the length of a <code>Buffer</code> created from the
|
|
102
|
-
string.</p>
|
|
103
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">str</span><span class="hl-1"> = </span><span class="hl-2">'</span><span class="hl-11">\u00bd</span><span class="hl-2"> + </span><span class="hl-11">\u00bc</span><span class="hl-2"> = </span><span class="hl-11">\u00be</span><span class="hl-2">'</span><span class="hl-1">;</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`</span><span class="hl-3">${</span><span class="hl-7">str</span><span class="hl-3">}</span><span class="hl-2">: </span><span class="hl-3">${</span><span class="hl-7">str</span><span class="hl-10">.</span><span class="hl-7">length</span><span class="hl-3">}</span><span class="hl-2"> characters, `</span><span class="hl-1"> +</span><br/><span class="hl-1"> </span><span class="hl-2">`</span><span class="hl-3">${</span><span class="hl-7">Buffer</span><span class="hl-10">.</span><span class="hl-0">byteLength</span><span class="hl-10">(</span><span class="hl-7">str</span><span class="hl-10">, </span><span class="hl-2">'utf8'</span><span class="hl-10">)</span><span class="hl-3">}</span><span class="hl-2"> bytes`</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: ½ + ¼ = ¾: 9 characters, 12 bytes</span>
|
|
104
|
-
</code><button>Copy</button></pre>
|
|
105
|
-
<p>When <code>string</code> is a
|
|
106
|
-
<code>Buffer</code>/<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView"><code>DataView</code></a>/[<code>TypedArray</code>](<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/-">https://developer.mozilla.org/en-US/docs/Web/JavaScript/-</a>
|
|
107
|
-
Reference/Global_Objects/TypedArray)/<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer"><code>ArrayBuffer</code></a>/[<code>SharedArrayBuffer</code>](<a href="https://develop-">https://develop-</a>
|
|
108
|
-
er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by <code>.byteLength</code>is returned.</p>
|
|
109
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">string</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.SharedArrayBuffer.html" class="tsd-signature-type tsd-kind-interface">SharedArrayBuffer</a><span class="tsd-signature-symbol"> | </span><a href="../types/_internal_.ArrayBufferView-1.html" class="tsd-signature-type tsd-kind-type-alias">ArrayBufferView</a></span><div class="tsd-comment tsd-typography"><p>A value to calculate the length of.</p>
|
|
110
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span><div class="tsd-comment tsd-typography"><p>If <code>string</code> is a string, this is its encoding.</p>
|
|
111
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><p>The number of bytes contained within <code>string</code>.</p>
|
|
112
|
-
<div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.90</p>
|
|
113
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:418</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="compare" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>compare</span><a href="#compare" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="compare.compare-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">compare</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">buf1</span>, <span class="tsd-kind-parameter">buf2</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">-1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span><a href="#compare.compare-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Compares <code>buf1</code> to <code>buf2</code>, typically for the purpose of sorting arrays of <code>Buffer</code> instances. This is equivalent to calling <code>buf1.compare(buf2)</code>.</p>
|
|
114
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf1</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">from</span><span class="hl-1">(</span><span class="hl-2">'1234'</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf2</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">from</span><span class="hl-1">(</span><span class="hl-2">'0123'</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">arr</span><span class="hl-1"> = [</span><span class="hl-7">buf1</span><span class="hl-1">, </span><span class="hl-7">buf2</span><span class="hl-1">];</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">arr</span><span class="hl-1">.</span><span class="hl-0">sort</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-7">compare</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]</span><br/><span class="hl-5">// (This result is equal to: [buf2, buf1].)</span>
|
|
115
|
-
</code><button>Copy</button></pre>
|
|
116
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">buf1</span>: <span class="tsd-signature-type">Uint8Array</span></span></li><li><span><span class="tsd-kind-parameter">buf2</span>: <span class="tsd-signature-type">Uint8Array</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">-1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span></h4><p>Either <code>-1</code>, <code>0</code>, or <code>1</code>, depending on the result of the comparison. See <code>compare</code> for details.</p>
|
|
117
|
-
<div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.11.13</p>
|
|
118
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:495</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="concat" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>concat</span><a href="#concat" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="concat.concat-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">concat</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">list</span>, <span class="tsd-kind-parameter">totalLength</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#concat.concat-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new <code>Buffer</code> which is the result of concatenating all the <code>Buffer</code> instances in the <code>list</code> together.</p>
|
|
119
|
-
<p>If the list has no items, or if the <code>totalLength</code> is 0, then a new zero-length <code>Buffer</code> is returned.</p>
|
|
120
|
-
<p>If <code>totalLength</code> is not provided, it is calculated from the <code>Buffer</code> instances
|
|
121
|
-
in <code>list</code> by adding their lengths.</p>
|
|
122
|
-
<p>If <code>totalLength</code> is provided, it is coerced to an unsigned integer. If the
|
|
123
|
-
combined length of the <code>Buffer</code>s in <code>list</code> exceeds <code>totalLength</code>, the result is
|
|
124
|
-
truncated to <code>totalLength</code>.</p>
|
|
125
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">// Create a single `Buffer` from a list of three `Buffer` instances.</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf1</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">10</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf2</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">14</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf3</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">18</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">totalLength</span><span class="hl-1"> = </span><span class="hl-7">buf1</span><span class="hl-1">.</span><span class="hl-7">length</span><span class="hl-1"> + </span><span class="hl-7">buf2</span><span class="hl-1">.</span><span class="hl-7">length</span><span class="hl-1"> + </span><span class="hl-7">buf3</span><span class="hl-1">.</span><span class="hl-7">length</span><span class="hl-1">;</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">totalLength</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: 42</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">bufA</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">concat</span><span class="hl-1">([</span><span class="hl-7">buf1</span><span class="hl-1">, </span><span class="hl-7">buf2</span><span class="hl-1">, </span><span class="hl-7">buf3</span><span class="hl-1">], </span><span class="hl-7">totalLength</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">bufA</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: <Buffer 00 00 00 00 ...></span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">bufA</span><span class="hl-1">.</span><span class="hl-7">length</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints: 42</span>
|
|
126
|
-
</code><button>Copy</button></pre>
|
|
127
|
-
<p><code>Buffer.concat()</code> may also use the internal <code>Buffer</code> pool like <code>Buffer.allocUnsafe()</code> does.</p>
|
|
128
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">list</span>: <span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>List of <code>Buffer</code> or Uint8Array instances to concatenate.</p>
|
|
129
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">totalLength</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Total length of the <code>Buffer</code> instances in <code>list</code> when concatenated.</p>
|
|
130
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.7.11</p>
|
|
131
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:460</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="copyBytesFrom" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>copy<wbr/>Bytes<wbr/>From</span><a href="#copyBytesFrom" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="copyBytesFrom.copyBytesFrom-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">copy<wbr/>Bytes<wbr/>From</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">view</span>, <span class="tsd-kind-parameter">offset</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">length</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#copyBytesFrom.copyBytesFrom-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Copies the underlying memory of <code>view</code> into a new <code>Buffer</code>.</p>
|
|
132
|
-
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">u16</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Uint16Array</span><span class="hl-1">([</span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">0xffff</span><span class="hl-1">]);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">copyBytesFrom</span><span class="hl-1">(</span><span class="hl-7">u16</span><span class="hl-1">, </span><span class="hl-9">1</span><span class="hl-1">, </span><span class="hl-9">1</span><span class="hl-1">);</span><br/><span class="hl-7">u16</span><span class="hl-1">[</span><span class="hl-9">1</span><span class="hl-1">] = </span><span class="hl-9">0</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">.</span><span class="hl-7">length</span><span class="hl-1">); </span><span class="hl-5">// 2</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">[</span><span class="hl-9">0</span><span class="hl-1">]); </span><span class="hl-5">// 255</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">buf</span><span class="hl-1">[</span><span class="hl-9">1</span><span class="hl-1">]); </span><span class="hl-5">// 255</span>
|
|
133
|
-
</code><button>Copy</button></pre>
|
|
134
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">view</span>: <a href="../types/_internal_.TypedArray.html" class="tsd-signature-type tsd-kind-type-alias">TypedArray</a></span><div class="tsd-comment tsd-typography"><p>The {TypedArray} to copy.</p>
|
|
135
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">offset</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The starting offset within <code>view</code>.</p>
|
|
136
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">length</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The number of elements from <code>view</code> to copy.</p>
|
|
137
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v19.8.0</p>
|
|
138
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:477</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="from" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>from</span><a href="#from" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="from.from-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">from</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">arrayBuffer</span>, <span class="tsd-kind-parameter">byteOffset</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">length</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#from.from-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Allocates a new <code>Buffer</code> using an <code>array</code> of bytes in the range <code>0</code> – <code>255</code>.
|
|
139
|
-
Array entries outside that range will be truncated to fit into it.</p>
|
|
140
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">// Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">buf</span><span class="hl-1"> = </span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">from</span><span class="hl-1">([</span><span class="hl-9">0x62</span><span class="hl-1">, </span><span class="hl-9">0x75</span><span class="hl-1">, </span><span class="hl-9">0x66</span><span class="hl-1">, </span><span class="hl-9">0x66</span><span class="hl-1">, </span><span class="hl-9">0x65</span><span class="hl-1">, </span><span class="hl-9">0x72</span><span class="hl-1">]);</span>
|
|
141
|
-
</code><button>Copy</button></pre>
|
|
142
|
-
<p>If <code>array</code> is an <code>Array</code>-like object (that is, one with a <code>length</code> property of
|
|
143
|
-
type <code>number</code>), it is treated as if it is an array, unless it is a <code>Buffer</code> or
|
|
144
|
-
a <code>Uint8Array</code>. This means all other <code>TypedArray</code> variants get treated as an <code>Array</code>. To create a <code>Buffer</code> from the bytes backing a <code>TypedArray</code>, use <code>Buffer.copyBytesFrom()</code>.</p>
|
|
145
|
-
<p>A <code>TypeError</code> will be thrown if <code>array</code> is not an <code>Array</code> or another type
|
|
146
|
-
appropriate for <code>Buffer.from()</code> variants.</p>
|
|
147
|
-
<p><code>Buffer.from(array)</code> and <code>Buffer.from(string)</code> may also use the internal <code>Buffer</code> pool like <code>Buffer.allocUnsafe()</code> does.</p>
|
|
148
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">arrayBuffer</span>: <a href="../types/_internal_.WithImplicitCoercion.html" class="tsd-signature-type tsd-kind-type-alias">WithImplicitCoercion</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBuffer</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.SharedArrayBuffer.html" class="tsd-signature-type tsd-kind-interface">SharedArrayBuffer</a><span class="tsd-signature-symbol">></span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">byteOffset</span>: <span class="tsd-signature-type">number</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">length</span>: <span class="tsd-signature-type">number</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v5.10.0</p>
|
|
149
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:322</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="from.from-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">from</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#from.from-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new Buffer using the passed {data}</p>
|
|
150
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>data to create a new Buffer</p>
|
|
151
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:331</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="from.from-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">from</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#from.from-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/_internal_.WithImplicitCoercion.html" class="tsd-signature-type tsd-kind-type-alias">WithImplicitCoercion</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:332</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="from.from-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">from</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">str</span>, <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#from.from-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new Buffer containing the given JavaScript string {str}.
|
|
152
|
-
If provided, the {encoding} parameter identifies the character encoding.
|
|
153
|
-
If not provided, {encoding} defaults to 'utf8'.</p>
|
|
154
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">str</span>: <a href="../types/_internal_.WithImplicitCoercion.html" class="tsd-signature-type tsd-kind-type-alias">WithImplicitCoercion</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-call-signature">[toPrimitive]</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">hint</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:338</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="isBuffer" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Buffer</span><a href="#isBuffer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="isBuffer.isBuffer-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">is<wbr/>Buffer</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-keyword"> is </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#isBuffer.isBuffer-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns <code>true</code> if <code>obj</code> is a <code>Buffer</code>, <code>false</code> otherwise.</p>
|
|
155
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isBuffer</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">alloc</span><span class="hl-1">(</span><span class="hl-9">10</span><span class="hl-1">)); </span><span class="hl-5">// true</span><br/><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isBuffer</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">from</span><span class="hl-1">(</span><span class="hl-2">'foo'</span><span class="hl-1">)); </span><span class="hl-5">// true</span><br/><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isBuffer</span><span class="hl-1">(</span><span class="hl-2">'a string'</span><span class="hl-1">); </span><span class="hl-5">// false</span><br/><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isBuffer</span><span class="hl-1">([]); </span><span class="hl-5">// false</span><br/><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isBuffer</span><span class="hl-1">(</span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Uint8Array</span><span class="hl-1">(</span><span class="hl-9">1024</span><span class="hl-1">)); </span><span class="hl-5">// false</span>
|
|
156
|
-
</code><button>Copy</button></pre>
|
|
157
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">obj</span>: <span class="tsd-signature-type">any</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-kind-parameter">obj</span><span class="tsd-signature-keyword"> is </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.101</p>
|
|
158
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:365</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="isEncoding" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Encoding</span><a href="#isEncoding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="isEncoding.isEncoding-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">is<wbr/>Encoding</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-keyword"> is </span><a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a><a href="#isEncoding.isEncoding-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns <code>true</code> if <code>encoding</code> is the name of a supported character encoding,
|
|
159
|
-
or <code>false</code> otherwise.</p>
|
|
160
|
-
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">'node:buffer'</span><span class="hl-1">;</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isEncoding</span><span class="hl-1">(</span><span class="hl-2">'utf8'</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints: true</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isEncoding</span><span class="hl-1">(</span><span class="hl-2">'hex'</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints: true</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isEncoding</span><span class="hl-1">(</span><span class="hl-2">'utf/8'</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints: false</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">Buffer</span><span class="hl-1">.</span><span class="hl-0">isEncoding</span><span class="hl-1">(</span><span class="hl-2">''</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints: false</span>
|
|
161
|
-
</code><button>Copy</button></pre>
|
|
162
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">encoding</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>A character encoding name to check.</p>
|
|
163
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-keyword"> is </span><a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.9.1</p>
|
|
164
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:388</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="of" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>of</span><a href="#of" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="of.of-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">of</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">items</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a><a href="#of.of-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new Buffer using the passed {data}</p>
|
|
165
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">items</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Buffer.html" class="tsd-signature-type tsd-kind-interface">Buffer</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:350</li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#constructor" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a><a href="#poolSize" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pool<wbr/>Size</span></a><a href="#alloc" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>alloc</span></a><a href="#allocUnsafe" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>alloc<wbr/>Unsafe</span></a><a href="#allocUnsafeSlow" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>alloc<wbr/>Unsafe<wbr/>Slow</span></a><a href="#byteLength" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>byte<wbr/>Length</span></a><a href="#compare" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>compare</span></a><a href="#concat" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>concat</span></a><a href="#copyBytesFrom" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>copy<wbr/>Bytes<wbr/>From</span></a><a href="#from" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>from</span></a><a href="#isBuffer" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Buffer</span></a><a href="#isEncoding" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Encoding</span></a><a href="#of" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>of</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@codebolt/codeboltjs</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Certificate | @codebolt/codeboltjs</title><meta name="description" content="Documentation for @codebolt/codeboltjs"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@codebolt/codeboltjs</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@codebolt/codeboltjs</a></li><li><a href="../modules/_internal_.html"><internal></a></li><li><a href="_internal_.Certificate.html">Certificate</a></li></ul><h1>Interface Certificate</h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">Certificate</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.Certificate.html#C">C</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.Certificate.html#CN">CN</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.Certificate.html#L">L</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.Certificate.html#O">O</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.Certificate.html#OU">OU</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.Certificate.html#ST">ST</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:17</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_internal_.Certificate.html#C" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>C</span></a>
|
|
2
|
-
<a href="_internal_.Certificate.html#CN" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>CN</span></a>
|
|
3
|
-
<a href="_internal_.Certificate.html#L" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>L</span></a>
|
|
4
|
-
<a href="_internal_.Certificate.html#O" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>O</span></a>
|
|
5
|
-
<a href="_internal_.Certificate.html#OU" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>OU</span></a>
|
|
6
|
-
<a href="_internal_.Certificate.html#ST" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ST</span></a>
|
|
7
|
-
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="C" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>C</span><a href="#C" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">C</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Country code.</p>
|
|
8
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:21</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="CN" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>CN</span><a href="#CN" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">CN</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Common name.</p>
|
|
9
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:41</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="L" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>L</span><a href="#L" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">L</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Locality.</p>
|
|
10
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:29</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="O" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>O</span><a href="#O" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">O</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Organization.</p>
|
|
11
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:33</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="OU" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>OU</span><a href="#OU" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">OU</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Organizational unit.</p>
|
|
12
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:37</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="ST" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>ST</span><a href="#ST" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">ST</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Street.</p>
|
|
13
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/tls.d.ts:25</li></ul></aside></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#C" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>C</span></a><a href="#CN" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>CN</span></a><a href="#L" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>L</span></a><a href="#O" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>O</span></a><a href="#OU" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>OU</span></a><a href="#ST" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ST</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@codebolt/codeboltjs</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ChatMessage | @codebolt/codeboltjs</title><meta name="description" content="Documentation for @codebolt/codeboltjs"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@codebolt/codeboltjs</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@codebolt/codeboltjs</a></li><li><a href="../modules/_internal_.html"><internal></a></li><li><a href="_internal_.ChatMessage.html">ChatMessage</a></li></ul><h1>Interface ChatMessage</h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">ChatMessage</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.ChatMessage.html#message">message</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.Message.html" class="tsd-signature-type tsd-kind-interface">Message</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_internal_.ChatMessage.html#type">type</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@codebolt/types/types/chatMessage.d.ts:4</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_internal_.ChatMessage.html#message" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>message</span></a>
|
|
2
|
-
<a href="_internal_.ChatMessage.html#type" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>type</span></a>
|
|
3
|
-
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="message" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>message</span><a href="#message" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.Message.html" class="tsd-signature-type tsd-kind-interface">Message</a></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@codebolt/types/types/chatMessage.d.ts:6</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="type" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>type</span><a href="#type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@codebolt/types/types/chatMessage.d.ts:5</li></ul></aside></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#message" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>message</span></a><a href="#type" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>type</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@codebolt/codeboltjs</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|