### Install @filen/sdk using NPM Source: https://sdk-ts-docs.filen.io/ This snippet shows how to install the latest version of the @filen/sdk package using NPM. Ensure you have Node.js and NPM installed on your system. ```bash npm install @filen/sdk@latest ``` -------------------------------- ### Get Start Number Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLOListElement.html The start property represents the starting number in a sequence or range. It is a number. ```typescript start: number; ``` -------------------------------- ### Initialize Filen SDK and Login Source: https://sdk-ts-docs.filen.io/ Demonstrates how to initialize the FilenSDK with configuration options and log in using email, password, and a two-factor authentication code. This setup is crucial for authenticating with Filen services. ```typescript import { FilenSDK } from "@filen/sdk" import path from "path" import os from "os" type FilenSDKConfig = { email?: string password?: string twoFactorCode?: string masterKeys?: string[] apiKey?: string publicKey?: string privateKey?: string authVersion?: AuthVersion baseFolderUUID?: string userId?: number metadataCache?: boolean // Cache decrypted metadata in memory. Recommended. tmpPath?: string // Temporary local path used to store metadata and chunks. Only available in Node.JS., connectToSocket?: boolean // Recommended if you are using the virtual FS class. Keeps the internal item tree up to date with remote changes. } // You can either directly supply all needed config parameters to the constructor or call the .login() function to fetch them using your login information. const filen = new FilenSDK({ metadataCache: true, connectToSocket: true, tmpPath: path.join(os.tmpdir(), "filen-sdk") }) await filen.login({ email: "your@email.com", password: "supersecret123", twoFactorCode: "123456" }) ``` -------------------------------- ### UserPublicKey Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserPublicKey.html Initializes a new instance of the UserPublicKey class. ```APIDOC ## Constructor UserPublicKey ### Description Creates an instance of UserPublicKey. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing the API client. * **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) * **UserPublicKey** (UserPublicKey) - The newly created UserPublicKey instance. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Get Start Time Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGSetElement.html Retrieves a start time value. The specific context or unit of this start time is not detailed here. ```typescript getStartTime(); ``` -------------------------------- ### Handling Animation Start Event Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGTextPathElement.html Fires when an animation begins. The handler receives an AnimationEvent, which can be used to get information about the animation that started. ```typescript declare const onanimationstart: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any); // Example usage: animatedElement.onanimationstart = (event) => { console.log('Animation started'); }; ``` -------------------------------- ### Get Start Time (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGAnimateTransformElement.html Retrieves the start time of an animation or media element in TypeScript. This indicates when the element's active duration begins. ```typescript getStartTime(): number; ``` -------------------------------- ### SearchFind Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.SearchFind.html Initializes a new instance of the SearchFind class. ```APIDOC ## new SearchFind(param0: { apiClient: APIClient }) ### Description Creates an instance of SearchFind. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing the API client. * **apiClient** (APIClient) - Required - The API client instance. ``` -------------------------------- ### UserBaseFolder Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserBaseFolder.html Initializes a new instance of the UserBaseFolder class. ```APIDOC ## constructor UserBaseFolder ### Description Creates an instance of UserBaseFolder. ### Method constructor ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```json { "apiClient": { /* APIClient object */ } } ``` ### Response #### Success Response (200) UserBaseFolder instance #### Response Example ```json { "instance": "UserBaseFolder" } ``` ``` -------------------------------- ### getSubStringLength Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGTextPositioningElement.html Gets the length of a substring starting from a specific character index. ```APIDOC ## GET /text/substringLength ### Description Calculates and returns the length of a substring starting from a given character index and for a specified number of characters. ### Method GET ### Endpoint /text/substringLength ### Parameters #### Query Parameters - **charNum** (number) - Required - The zero-based starting index of the substring. - **nchars** (number) - Required - The number of characters in the substring. ### Response #### Success Response (200) - **number** - The length of the substring. #### Response Example ```json 10 ``` ``` -------------------------------- ### Instantiate API with FilenSDK Source: https://sdk-ts-docs.filen.io/classes/_internal_.API.html Demonstrates how to create a new instance of the API class. This requires an initialized FilenSDK object as a parameter. The constructor sets up the API client for interacting with Filen services. ```typescript import { FilenSDK } from "@filen/sdk"; import { API } from "@filen/sdk"; // Assuming sdk is an initialized instance of FilenSDK const sdk: FilenSDK = new FilenSDK({ // SDK configuration options }); const api: API = new API(sdk); ``` -------------------------------- ### getStartPositionOfChar Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGTextPositioningElement.html Gets the start position of a character within the text content. ```APIDOC ## GET /text/char/{charNum}/startPosition ### Description Retrieves the start position (DOMPoint) of a specific character within the text content. ### Method GET ### Endpoint /text/char/{charNum}/startPosition ### Parameters #### Path Parameters - **charNum** (number) - Required - The zero-based index of the character. ### Response #### Success Response (200) - **DOMPoint** - An object representing the coordinates (x, y) of the character's start position. #### Response Example ```json { "x": 5.0, "y": 20.0 } ``` ``` -------------------------------- ### Getting Character Position in SVG Text Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGTextPositioningElement.html This snippet demonstrates methods for retrieving positional information about characters within an SVG text element. It includes getting the starting position of a character and the length of a substring. ```typescript getStartPositionOfChar(charnum: number): DOMPoint; ``` -------------------------------- ### AuthInfo Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.AuthInfo.html Initializes a new instance of the AuthInfo class. ```APIDOC ## AuthInfo constructor ### Description Creates an instance of AuthInfo. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "apiClient": "APIClient_instance" } ``` ### Response #### Success Response (200) AuthInfo instance #### Response Example ```json { "instance": "AuthInfo" } ``` ``` -------------------------------- ### Initialize SDK API Source: https://sdk-ts-docs.filen.io/classes/FilenSDK.html Initializes the SDK. This might be necessary after logging in. ```APIDOC ## Initialize SDK API ### Description Initializes the SDK. This might be necessary after logging in. ### Method `init` ### Endpoint `/init` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **params** (FilenSDKConfig) - Optional - Configuration object for SDK initialization. ### Request Example ```javascript // Initialize the SDK with optional configuration // init({ // baseUrl: 'https://api.filen.io' // }); // Initialize the SDK without configuration // init(); ``` ### Response #### Success Response (200) void - Indicates successful initialization. #### Response Example ```json // No specific response body is detailed, success is indicated by the status code. ``` ``` -------------------------------- ### Get Tag Name Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLOListElement.html The tagName property returns the HTML-uppercased qualified name of the element. For example, 'DIV' for a
element. ```typescript tagName: string; ``` -------------------------------- ### Get WebGL Vertex Attribute Offset Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.WebGLRenderingContextBase.html Retrieves the offset of a vertex attribute. This function is used in conjunction with vertex buffer objects to determine the starting position of attribute data. ```javascript function getVertexAttribOffset(index: number, pname: number): number; ``` -------------------------------- ### FileSystemGetFileOptions Interface Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.FileSystemGetFileOptions.html Details the options available when retrieving a file using the File System SDK. This includes an optional 'create' flag. ```APIDOC ## Interface FileSystemGetFileOptions ### Description This interface defines the options available for the `getFile` operation within the File System SDK. It allows for specifying whether to create the file if it does not exist. ### Properties #### `create` (boolean) - Optional If set to `true`, the file will be created if it does not already exist. Defaults to `false`. ``` -------------------------------- ### Animation and Rendering Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGFEConvolveMatrixElement.html Methods for animating elements and retrieving rendering-related information. This includes starting animations and getting computed dimensions. ```typescript animate(keyframes: null | Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation; getAnimations(options?: GetAnimationsOptions): Animation[]; getHTML(options?: GetHTMLOptions): string; scrollLeft: number; scrollTop: number; scrollWidth: number; scrollHeight: number; ``` -------------------------------- ### Worker Constructor Example Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.Worker.html Demonstrates how to create a new Web Worker by providing the path to the script that the worker thread will execute. This is the primary method for initiating background tasks. ```javascript const myWorker = new Worker("path/to/worker/script.js"); ``` -------------------------------- ### UserSubCreate.fetch Method Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserSubCreate.html Initiates the subscription payment flow. This asynchronous method requires the payment method and plan ID. ```APIDOC ## fetch UserSubCreate ### Description Create a subscription payment flow. ### Method fetch ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing payment details. * **method** (PaymentMethods) - Required - The payment method to use. * **planId** (number) - Required - The ID of the subscription plan. ### Request Example ```json { "method": "", "planId": 123 } ``` ### Response #### Success Response (200) * **UserSubCreateResponse** (object) - The response from creating the subscription payment flow. #### Response Example ```json { "status": "success", "data": { "paymentUrl": "https://example.com/pay?token=..." } } ``` ``` -------------------------------- ### Manipulate Character Data - SVGTextPathElement Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGTextPathElement.html Methods for retrieving and manipulating character-specific data within an SVG text element. This includes getting rotation, start position, and substring length, as well as selecting substrings. ```typescript getRotationOfChar(charnum: number): number; getStartPositionOfChar(charnum: number): DOMPoint; getSubStringLength(charnum: number, nchars: number): number; selectSubString(charnum: number, nchars: number): void; ``` -------------------------------- ### Initialize UserSettings with APIClient Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserSettings.html Creates a new instance of the UserSettings class. This constructor requires an APIClient object to be passed as a parameter, which is used for making API requests to fetch user settings. ```typescript new UserSettings({ apiClient: APIClient }) ``` -------------------------------- ### Get Substring from Node Data (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.CharacterData.html Extracts a portion of the node's data as a string, starting at a specified offset and for a given count. This method is useful for reading parts of text nodes without modifying them. ```typescript substringData(offset: number, count: number): string ``` -------------------------------- ### Get All Keys from Object Store - JavaScript Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.IDBObjectStore.html Provides an example of retrieving all keys from an IndexedDB object store using the `getAllKeys` method. Similar to `getAll`, it accepts an optional query and count. The method returns an array of all matching keys. ```javascript objectStore.getAllKeys(query, count); ``` -------------------------------- ### Initialize UserKeyPairSet with APIClient Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserKeyPairSet.html Creates a new instance of UserKeyPairSet. Requires an APIClient instance for its operations. This is the primary way to instantiate the UserKeyPairSet. ```typescript import { APIClient } from "@filen/sdk"; const apiClient = new APIClient(/* ... */); const userKeyPairSet = new UserKeyPairSet({ apiClient: apiClient }); ``` -------------------------------- ### User Class Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.User.html Initializes a new User instance with the provided FilenSDK instance. ```APIDOC ## Constructor User ### Description Initializes a new User instance. ### Method constructor ### Parameters #### Path Parameters - **sdk** (FilenSDK) - Required - The FilenSDK instance to be used. ### Returns - **User** - The newly created User instance. ``` -------------------------------- ### Get Point at SVG Path Length (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGCircleElement.html Returns the coordinates (as a DOMPoint) of a point along the path of an SVG element at a specified distance from its start. This is useful for animating along paths or placing elements at specific points on a path. ```typescript getPointAtLength(distance: number): DOMPoint; ``` -------------------------------- ### Handle Transition Events in JavaScript Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLAreaElement.html Provides examples for handling various CSS transition events in JavaScript. These events are triggered when a CSS transition starts, ends, runs, or is cancelled. They are useful for synchronizing JavaScript logic with visual transitions. ```javascript const element = document.getElementById('myElement'); // Handle transitioncancel element.ontransitioncancel = (event) => { console.log('Transition cancelled:', event); }; // Handle transitionend element.ontransitionend = (event) => { console.log('Transition ended:', event); }; // Handle transitionrun element.ontransitionrun = (event) => { console.log('Transition running:', event); }; // Handle transitionstart element.ontransitionstart = (event) => { console.log('Transition started:', event); }; ``` -------------------------------- ### APIClient - Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.APIClient.html Initializes a new instance of the APIClient. ```APIDOC ## constructor APIClient ### Description Initializes a new instance of the APIClient. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "sdk": "FilenSDK_instance" } ``` ### Response #### Success Response (200) APIClient instance #### Response Example ```json { "message": "APIClient initialized successfully" } ``` ``` -------------------------------- ### API Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.API.html Initializes a new instance of the API class with the provided FilenSDK instance. ```APIDOC ## constructor API ### Description Initializes a new instance of the API class. ### Method constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript // Assuming FilenSDK is already initialized const sdk = new FilenSDK({ // SDK options }); const api = new API(sdk); ``` ### Response #### Success Response (200) N/A (Constructor does not return a value in the traditional sense) #### Response Example N/A ``` -------------------------------- ### TimeRanges Methods: start() Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.TimeRanges.html Shows the 'start' method of the TimeRanges interface. It returns the start time of a specified range by its index. An 'IndexSizeError' is thrown if the index is out of bounds. ```typescript start(index: number): number ``` -------------------------------- ### Initialize File.io SDK Source: https://sdk-ts-docs.filen.io/classes/FilenSDK.html Initializes the File.io SDK with a specified version. This is the entry point for accessing all SDK functionalities. ```typescript const sdk = new filen_io.api( 1 ); ``` -------------------------------- ### Get Elements By Name Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.XMLDocument.html Gets a collection of objects based on the value of the NAME or ID attribute. ```typescript getElementsByName(elementName: string): NodeListOf ``` -------------------------------- ### Register Fetch Method Source: https://sdk-ts-docs.filen.io/classes/_internal_.Register.html Creates a new user account using the provided credentials and parameters. ```APIDOC ## Methods ### fetch `fetch(param0: { affId?: string; authVersion: AuthVersion; email: string; password: string; refId?: string; salt: string; }): Promise` Create an account. #### Parameters * `param0` (object) - Required - An object containing account creation details. * `affId` (string) - Optional - Affiliate ID. * `authVersion` (AuthVersion) - Required - The authentication version. * `email` (string) - Required - The user's email address. * `password` (string) - Required - The user's password. * `refId` (string) - Optional - Referral ID. * `salt` (string) - Required - The salt for password hashing. #### Returns * `Promise` - A promise that resolves when the account is created. ``` -------------------------------- ### Axios Method: Get Request Source: https://sdk-ts-docs.filen.io/classes/_internal_.Axios.html Sends a GET request to the specified URL. Optional configuration can be provided to customize the request. ```typescript get, D = any>( url: string, config?: AxiosRequestConfig ): Promise ``` -------------------------------- ### Instantiate ChatMute with APIClient Source: https://sdk-ts-docs.filen.io/classes/_internal_.ChatMute.html Demonstrates how to create a new instance of the ChatMute class. This requires an instance of APIClient to be passed during initialization. ```typescript import { APIClient, ChatMute } from "@filen/sdk"; // Assuming apiClient is an initialized instance of APIClient const apiClient: APIClient = ...; const chatMute = new ChatMute({ apiClient: apiClient }); ``` -------------------------------- ### DirLinkInfo Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.DirLinkInfo.html Creates an instance of DirLinkInfo. Requires an APIClient instance. ```APIDOC ## Constructor DirLinkInfo ### Description Creates an instance of DirLinkInfo. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param0** (object) - Required - An object containing the apiClient. - **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) - **DirLinkInfo** (object) - An instance of DirLinkInfo. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Handle Select Start Event Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLLIElement.html This event handler is triggered when the user starts selecting text. It accepts a callback function that receives an Event object. ```typescript onselectstart: null | (this: GlobalEventHandlers, ev: Event) => any ``` -------------------------------- ### GetRequestParameters Type Alias Source: https://sdk-ts-docs.filen.io/types/_internal_.GetRequestParameters.html Defines the structure for parameters used in GET requests, including optional raw inclusion and the mandatory GET method. ```APIDOC ## Type Alias GetRequestParameters ### Description This type alias represents the parameters required for making a GET request using the Filen SDK. It extends `BaseRequestParameters` and adds specific properties for GET requests. ### Type Definition ```typescript GetRequestParameters: BaseRequestParameters & { includeRaw?: boolean; method: "GET"; } ``` ### Properties #### BaseRequestParameters (Inherited) * **path** (string) - Required - The endpoint path for the request. * **headers** (object) - Optional - Custom headers to include in the request. * **query** (object) - Optional - Query parameters to append to the URL. #### GetRequestParameters Specific Properties * **includeRaw** (boolean) - Optional - If true, the raw response will be included. * **method** (string literal "GET") - Required - Specifies that this request uses the GET HTTP method. ``` -------------------------------- ### DOMMatrix Constructor and Static Methods Source: https://sdk-ts-docs.filen.io/variables/_internal_.DOMMatrix-1.html Details about creating and initializing DOMMatrix objects. ```APIDOC ## DOMMatrix ### Description Represents a 4x4 matrix, used for transformations. ### Methods #### `new DOMMatrix(init?: string | number[])` Creates a new DOMMatrix object. ##### Parameters - `init` (string | number[]) - Optional. An array of numbers or a string representing the initial matrix values. ##### Returns - `DOMMatrix` - A new DOMMatrix object. #### `DOMMatrix.fromFloat32Array(array32: Float32Array): DOMMatrix` Creates a DOMMatrix from a Float32Array. ##### Parameters - `array32` (Float32Array) - The Float32Array to create the matrix from. ##### Returns - `DOMMatrix` - A new DOMMatrix object. #### `DOMMatrix.fromFloat64Array(array64: Float64Array): DOMMatrix` Creates a DOMMatrix from a Float64Array. ##### Parameters - `array64` (Float64Array) - The Float64Array to create the matrix from. ##### Returns - `DOMMatrix` - A new DOMMatrix object. #### `DOMMatrix.fromMatrix(other?: DOMMatrixInit): DOMMatrix` Creates a DOMMatrix from another DOMMatrix or DOMMatrixInit object. ##### Parameters - `other` (DOMMatrixInit) - Optional. An object containing matrix properties to initialize from. ##### Returns - `DOMMatrix` - A new DOMMatrix object. ``` -------------------------------- ### Get and Set 'part' Property Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLLinkElement.html Demonstrates how to get and set the 'part' attribute of an HTMLLinkElement, which is a DOMTokenList. This attribute is used for shadow DOM slotting. ```typescript const linkElement: HTMLLinkElement = document.createElement('link'); // Get the 'part' attribute const partList: DOMTokenList = linkElement.part; console.log(partList); // Example output: DOMTokenList [] // Set the 'part' attribute linkElement.part.add('my-part'); console.log(linkElement.part.value); // Example output: "my-part" linkElement.part = 'another-part'; // This will overwrite existing parts console.log(linkElement.part.value); // Example output: "another-part" ``` -------------------------------- ### Object Interface Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.Object.html Details about the Object interface, its constructor, properties, and methods. ```APIDOC ## Interface Object ### Description Represents a generic JavaScript object. ### Properties #### constructor - **constructor** (Function) - The constructor function that created the object. ### Methods - **hasOwnProperty** (v: PropertyKey): boolean - Determines whether an object has a property with the specified name. - **isPrototypeOf** (v: Object): boolean - Determines whether an object exists in another object's prototype chain. - **propertyIsEnumerable** (v: PropertyKey): boolean - Determines whether a specified property is enumerable. - **toLocaleString** (): string - Returns a date converted to a string using the current locale. - **toString** (): string - Returns a string representation of an object. - **valueOf** (): Object - Returns the primitive value of the specified object. ## Properties ### constructor - **constructor** (Function) - The initial value of Object.prototype.constructor is the standard built-in Object constructor. ## Methods ### hasOwnProperty #### Description Determines whether an object has a property with the specified name. #### Parameters - **v** (PropertyKey) - Required - A property name. #### Returns - boolean ### isPrototypeOf #### Description Determines whether an object exists in another object's prototype chain. #### Parameters - **v** (Object) - Required - Another object whose prototype chain is to be checked. #### Returns - boolean ### propertyIsEnumerable #### Description Determines whether a specified property is enumerable. #### Parameters - **v** (PropertyKey) - Required - A property name. #### Returns - boolean ### toLocaleString #### Description Returns a date converted to a string using the current locale. #### Parameters None #### Returns - string ### toString #### Description Returns a string representation of an object. #### Parameters None #### Returns - string ### valueOf #### Description Returns the primitive value of the specified object. #### Parameters None #### Returns - Object ``` -------------------------------- ### UserKeyPairSet Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserKeyPairSet.html Creates an instance of UserKeyPairSet. Requires an APIClient instance. ```APIDOC ## Constructor UserKeyPairSet ### Description Creates an instance of UserKeyPairSet. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing the apiClient. * **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) * **UserKeyPairSet** (object) - The newly created UserKeyPairSet instance. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### MediaStreamTrack addEventListener Example Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.MediaStreamTrack.html Demonstrates how to add an event listener to a MediaStreamTrack. This example shows adding a listener for the 'ended' event, which is triggered when the track is stopped. ```typescript const track = ... // Obtain a MediaStreamTrack instance track.addEventListener('ended', (event) => { console.log('MediaStreamTrack ended:', event); }); ``` -------------------------------- ### UserMasterKeys Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.UserMasterKeys.html Initializes a new instance of the UserMasterKeys class. ```APIDOC ## UserMasterKeys Constructor ### Description Creates an instance of UserMasterKeys. ### Method constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing API client details. * **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) * **UserMasterKeys** (object) - The newly created UserMasterKeys instance. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Handle Webkit Animation Start Event (Deprecated) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLOListElement.html This is a legacy alias for the onanimationstart event, indicating the start of a CSS webkit animation. It is deprecated. ```typescript onwebkitanimationstart: null | ((this: GlobalEventHandlers, ev: Event) => any); ``` -------------------------------- ### Toggle, Touch, and Transition Event Handlers Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGPolygonElement.html Handlers for toggle, touch events (cancel, end, move, start), and transition events (cancel, end, run, start). ```APIDOC ## Toggle, Touch, and Transition Event Handlers ### ontoggle **Description**: Handles toggle events. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontouchcancel **Description**: Handles the cancellation of a touch event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontouchend **Description**: Handles the end of a touch event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontouchmove **Description**: Handles touch movement events. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontouchstart **Description**: Handles the start of a touch event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontransitioncancel **Description**: Handles the cancellation of a transition event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontransitionend **Description**: Handles the end of a transition event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontransitionrun **Description**: Handles the running of a transition event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ### ontransitionstart **Description**: Handles the start of a transition event. **Method**: Not applicable (event handler) **Endpoint**: Not applicable ``` -------------------------------- ### POST /websites/sdk-ts-docs_filen_io Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.AxiosInstance.html Creates a new resource using the POST method. It accepts a URL, optional data, and optional configuration. ```APIDOC ## POST /websites/sdk-ts-docs_filen_io ### Description Creates a new resource using the POST method. It accepts a URL, optional data, and optional configuration. ### Method POST ### Endpoint /websites/sdk-ts-docs_filen_io ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **url** (string) - Required - The URL to create the resource at. - **data** (D) - Optional - The data to send in the request body. - **config** (AxiosRequestConfig) - Optional - Configuration options for the request. ### Request Example ```json { "url": "/files", "data": { "name": "new_file.txt", "content": "This is the file content." } } ``` ### Response #### Success Response (200) - **data** (T) - The response data from the server. #### Response Example ```json { "message": "File created successfully", "fileId": "456" } ``` ``` -------------------------------- ### MediaKeyStatusMap Methods: get Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.MediaKeyStatusMap.html The 'get' method retrieves the MediaKeyStatus associated with a given key ID from the MediaKeyStatusMap. It returns the status if found, or undefined if the key ID is not present. ```typescript get(keyId: BufferSource): undefined | MediaKeyStatus; ``` -------------------------------- ### NotesTagsCreate Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.NotesTagsCreate.html Initializes a new instance of the NotesTagsCreate class. ```APIDOC ## Constructor NotesTagsCreate ### Description Creates an instance of NotesTagsCreate. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param0** (object) - Required - An object containing the API client. - **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) - **NotesTagsCreate** (object) - The newly created NotesTagsCreate instance. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Example of Prepending and Once Listeners (JavaScript) Source: https://sdk-ts-docs.filen.io/classes/_internal_.EventEmitter-2.html This example demonstrates the behavior of `prependOnceListener` in conjunction with `once`. It shows how listeners added to the beginning are executed first, and how `once` listeners are removed after their first execution. ```javascript import { EventEmitter } from 'node:events'; const myEE = new EventEmitter(); myEE.once('foo', () => console.log('a')); myEE.prependOnceListener('foo', () => console.log('b')); myEE.emit('foo'); // Prints: // b // a ``` -------------------------------- ### ChatTyping Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.ChatTyping.html Initializes a new instance of the ChatTyping class. ```APIDOC ## new ChatTyping(param0: { apiClient: APIClient }) ### Description Creates an instance of ChatTyping. ### Method CONSTRUCTOR ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing the API client. * **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) * **ChatTyping** (object) - The newly created ChatTyping instance. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Handle Drag Start Event in TypeScript Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLHRElement.html The ondragstart event handler fires on the source object when the user starts to drag a text selection or selected object. It accepts a DragEvent. ```typescript ondragstart: null | (this: GlobalEventHandlers, ev: DragEvent) => any; ``` -------------------------------- ### Initialize SearchFind Instance Source: https://sdk-ts-docs.filen.io/classes/_internal_.SearchFind.html Creates a new instance of the SearchFind class. This constructor requires an APIClient instance to be passed as a parameter. ```typescript new SearchFind({ apiClient: new APIClient() }); ``` -------------------------------- ### Handle Media Playback Started Event Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLLIElement.html This event handler is triggered when the play method is requested, indicating the start of media playback. It accepts a callback function that receives an Event object. ```typescript onplay: null | (this: GlobalEventHandlers, ev: Event) => any ``` -------------------------------- ### FileSystemGetDirectoryOptions Interface Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.FileSystemGetDirectoryOptions.html Details the options available when retrieving directory information using the File System SDK. ```APIDOC ## Interface FileSystemGetDirectoryOptions ### Description This interface defines the optional parameters for the `getDirectory` method in the File System SDK. ### Properties #### `create` (boolean) - Optional If set to `true`, the directory will be created if it does not already exist. ``` -------------------------------- ### FileGet Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.FileGet.html Initializes a new instance of the FileGet class. ```APIDOC ## new FileGet(apiClient: APIClient) ### Description Creates an instance of FileGet. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) FileGet instance #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Get Fragment Data Location Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.WebGL2RenderingContext.html Gets the location of a fragment shader's varying variable. This function requires a WebGLProgram and the name of the varying variable as a string, returning its location as a number. ```typescript declare function getFragDataLocation(program: WebGLProgram, name: string): number; ``` -------------------------------- ### Get and Set Element Style (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGAnimateMotionElement.html Shows how to get and set the inline styles of an element using the `style` accessor. This allows direct manipulation of CSS properties. ```typescript const element = document.getElementById('myElement'); // Get the style object const style: CSSStyleDeclaration = element.style; console.log(style); // Set individual style properties style.color = 'blue'; style.fontSize = '16px'; // Set the entire style string element.style.cssText = 'color: red; background-color: yellow;'; ``` -------------------------------- ### Initialize Filen SDK Source: https://sdk-ts-docs.filen.io/classes/FilenSDK.html Initializes the Filen SDK, optionally with configuration parameters. This is typically done once before using other SDK functions. ```typescript import FilenSDK from "filen-sdk"; // Initialize with default configuration FilenSDK.init(); // Initialize with custom configuration FilenSDK.init({ // configuration options }); ``` -------------------------------- ### PushSubscriptionOptionsInit Interface Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.PushSubscriptionOptionsInit.html Defines the structure for initializing push subscription options. ```APIDOC ## Interface PushSubscriptionOptionsInit ### Description An interface that defines the structure for initializing push subscription options. It allows specifying an application server key and whether user-visible notifications are required. ### Properties #### `applicationServerKey` - **Type**: `null | string | BufferSource` - **Optional**: Yes - **Description**: The public key of the application server used for authentication. #### `userVisibleOnly` - **Type**: `boolean` - **Optional**: Yes - **Description**: A boolean value indicating whether the push notification should be user-visible. If true, the notification must be displayed to the user. ``` -------------------------------- ### Getting and Setting Element Attributes Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLBaseElement.html Provides methods for retrieving and setting attributes on an HTML element. This includes methods for getting attributes by name, qualified name, and namespace. ```typescript element.getAttribute(qualifiedName: string): null | string; element.getAttributeNames(): string[]; element.getAttributeNode(qualifiedName: string): null | Attr; element.getAttributeNodeNS( namespace: null | string, localName: string, ): null | Attr; element.getAttributeNS(namespace: null | string, localName: string): null | string; ``` -------------------------------- ### IDBIndex Methods: get Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.IDBIndex.html Implements the get method for IDBIndex, used to retrieve the value of the first record that matches a specified key or key range. Returns an IDBRequest or undefined if no match is found. ```typescript get(query: IDBValidKey | IDBKeyRange): IDBRequest ``` -------------------------------- ### Axios Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.Axios.html Details on how to instantiate the Axios class with optional configuration. ```APIDOC ## Constructors ### constructor * `new Axios(config?: AxiosRequestConfig): Axios` #### Parameters * `Optional` config: AxiosRequestConfig - Configuration object for the Axios instance. #### Returns * `Axios` - An instance of the Axios class. ``` -------------------------------- ### NotesCreate Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.NotesCreate.html Initializes a new instance of the NotesCreate class. ```APIDOC ## Constructor ### constructor Creates an instance of NotesCreate. #### Parameters * **param0** (object) - Required - An object containing the API client. * **apiClient** (APIClient) - Required - The API client instance. #### Returns * **NotesCreate** - An instance of the NotesCreate class. ``` -------------------------------- ### Handle Webkit Animation Start Event (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGCircleElement.html Callback function executed when a webkitAnimationStart event occurs. This event fires when a CSS animation starts. The handler receives the event object. ```typescript onwebkitanimationstart: | null | (this: GlobalEventHandlers, ev: Event) => any; ``` -------------------------------- ### Initialize FilenSDK Instance Source: https://sdk-ts-docs.filen.io/classes/FilenSDK.html Creates a new instance of the FilenSDK. This constructor can optionally accept configuration parameters, an array of SDK workers, and an Axios instance for custom HTTP client configurations. ```typescript new FilenSDK( params?: FilenSDKConfig, workers?: SDKWorker[], axiosInstance?: AxiosInstance ): FilenSDK ``` -------------------------------- ### Get and Set Element Part Attribute (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGAnimateMotionElement.html Illustrates how to get and set the `part` attribute of an element using the `part` accessor. This is useful for styling elements within a Shadow DOM. ```typescript const element = document.getElementById('myElement'); // Get the part list const parts: DOMTokenList = element.part; console.log(parts); // Set the part attribute element.part.add('part1'); element.part.remove('part2'); // Alternatively, set the entire part string element.part = 'partA partB'; ``` -------------------------------- ### ItemShare Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.ItemShare.html Initializes a new instance of the ItemShare class. ```APIDOC ## new ItemShare(param0: { apiClient: APIClient }) ### Description Creates an instance of ItemShare. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **param0** ({ apiClient: APIClient }) - Required - An object containing the APIClient. ### Request Example ```json { "apiClient": "" } ``` ### Response #### Success Response (200) ItemShare instance #### Response Example ```json { "message": "ItemShare instance created successfully" } ``` ``` -------------------------------- ### Get Record from Object Store - JavaScript Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.IDBObjectStore.html Shows how to retrieve a single record from an IndexedDB object store using the `get` method with a specified key or key range. The method returns the requested record. ```javascript objectStore.get(query); ``` -------------------------------- ### NotesContent Constructor Source: https://sdk-ts-docs.filen.io/classes/_internal_.NotesContent.html Initializes a new instance of the NotesContent class. ```APIDOC ## constructor NotesContent ### Description Creates an instance of NotesContent. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **param0** (object) - Required - An object containing the API client. * **apiClient** (APIClient) - Required - The API client instance. ### Request Example ```json { "param0": { "apiClient": "" } } ``` ### Response #### Success Response (200) * **NotesContent** (object) - The newly created NotesContent instance. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Control Element Scroll Position in JavaScript Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.HTMLAreaElement.html Illustrates how to get and set the scroll position of an element using `scrollLeft` and `scrollTop`, and how to get the total scrollable dimensions using `scrollWidth` and `scrollHeight` in JavaScript. ```javascript const scrollableDiv = document.getElementById('scrollableContainer'); // Get current scroll position console.log('Scroll Left:', scrollableDiv.scrollLeft); console.log('Scroll Top:', scrollableDiv.scrollTop); // Set scroll position scrollableDiv.scrollLeft = 100; scrollableDiv.scrollTop = 200; // Get total scrollable dimensions console.log('Scroll Width:', scrollableDiv.scrollWidth); console.log('Scroll Height:', scrollableDiv.scrollHeight); ``` -------------------------------- ### Get Element's Scroll Dimensions (TypeScript) Source: https://sdk-ts-docs.filen.io/interfaces/_internal_.SVGGeometryElement.html Provides properties to get the dimensions of an element's scrollable content. `scrollWidth` is the minimum width of the element's content, and `scrollHeight` is the minimum height. ```typescript scrollWidth: number;scrollHeight: number; ```