export declare const _forbiddenHeaders: { readonly value: any; }; /** * Implements the WASI Preview3 fields resource for HTTP headers and trailers */ export declare class Fields { #private; /** * Constructs an empty HTTP Fields * WIT: * ``` * constructor(); * ``` */ constructor(); /** * Constructs a Fields instance from a list of name-value pairs * WIT: * ``` * from-list: static func(entries: list>) -> result; * ``` * * @param {[string, Uint8Array[]][]} entries - List of field name and value pairs * @returns {Fields} A new Fields instance * @throws {HttpError} With payload.tag 'invalid-syntax' if any name or value is invalid * @throws {HttpError} With payload.tag 'forbidden' if any name is forbidden */ static fromList(entries: any): Fields; /** * Get all values for a given field name * WIT: * ``` * get: func(name: field-name) -> list; * ``` * * @param {string} name - The field name to get values for * @returns {Uint8Array[]} List of values for the field */ get(name: any): any; /** * Check if a field name exists in the collection * WIT: * ``` * has: func(name: field-name) -> bool; * ``` * * @param {string} name - The field name to check * @returns {boolean} True if the field exists */ has(name: any): boolean; /** * Set values for a field name, replacing any existing values * WIT: * ``` * set: func(name: field-name, value: list) -> result<_, header-error>; * ``` * * @param {string} name - The field name * @param {Uint8Array[]} values - The values to set * @throws {HttpError} With payload.tag 'immutable' if the fields are immutable * @throws {HttpError} With payload.tag 'invalid-syntax' if name or values are invalid * @throws {HttpError} With payload.tag 'forbidden' if name is forbidden */ set(name: any, values: any): void; /** * Delete all values for a field name * WIT: * ``` * delete: func(name: field-name) -> result<_, header-error>; * ``` * * @param {string} name - The field name to delete * @throws {HttpError} With payload.tag 'immutable' if the fields are immutable */ delete(name: any): void; /** * Get all values for a field name and then delete them * WIT: * ``` * get-and-delete: func(name: field-name) -> result, header-error>; * ``` * * @param {string} name - The field name to get and delete * @returns {Uint8Array[]} List of values that were deleted * @throws {HttpError} With payload.tag 'immutable' if the fields are immutable */ getAndDelete(name: any): any; /** * Append a value to a field name * WIT: * ``` * append: func(name: field-name, value: field-value) -> result<_, header-error>; * ``` * * @param {string} name - The field name * @param {Uint8Array} value - The value to append * @throws {HttpError} With payload.tag 'immutable' if the fields are immutable * @throws {HttpError} With payload.tag 'invalid-syntax' if name or value is invalid * @throws {HttpError} With payload.tag 'forbidden' if name is forbidden */ append(name: any, value: any): void; /** * Get all entries as a list of name-value pairs * WIT: * ``` * copy-all: func() -> list>; * ``` * * @returns {[string, Uint8Array][]} List of all entries */ copyAll(): any[]; /** * Create a deep copy of this Fields instance * WIT: * ``` * clone: func() -> fields; * ``` * * @returns {Fields} A new mutable Fields instance with the same entries */ clone(): Fields; /** * Mark fields as immutable * * @param {Fields} fields - The Fields instance to mark as immutable * @returns {Fields} The same instance, now immutable */ static _lock(fields: any): any; /** * Create a Fields instance from pre-validated entries * * @param {[string, Uint8Array][]} entries - Validated entries to use * @returns {Fields} A new Fields instance with the provided entries */ static _fromEntriesChecked(entries: any): Fields; } export declare function _fieldsLock(fields: any): any; export declare function _fieldsFromEntriesChecked(entries: any): Fields; export declare function _readTrailersForTransport(trailers: any): Promise; export declare function _trailerResultFromEntries(entries: any): { tag: string; val: Fields; };