/** * Static facade for converting GearN numeric codes into the * lowercase-first-letter display names the backend expects on the * wire (and that look familiar in log lines). * * Categories: * - `getReturnCodeName(returnCode)` — translates the * {@link ReturnCode} value carried by every response. * - `getRequestTypeName(requestType)` — translates the * {@link RequestType} enum to the camelCase string used in * {@link OperationHelper.toSocketData} and the HTTP URL. * - `getRequestRoleName(requestRole)` — translates the * {@link RequestRole} enum the same way. * - `getInvalidMemberName(invalidMember)` — translates the * {@link InvalidMemberType} enum used in * {@link OperationResponse.getInvalidMembers}. * * Lifecycle: {@link init} runs from {@link GNNetwork.init} before * any model serialisation happens. After init, the lookups are * effectively immutable; the SDK does not expose a teardown. * * Extensibility: each category exposes an `add*Dic` method so * downstream applications can extend the lookup table with their * own enum values without forking the SDK. This is mostly used by * white-label deployments that introduce custom return codes. */ export declare class CodeHelper { /** Helper backing {@link getReturnCodeName}. */ private static returnCodeHelper; /** Helper backing {@link getRequestTypeName}. */ private static requestTypeHelper; /** Helper backing {@link getRequestRoleName}. */ private static requestRoleHelper; /** Helper backing {@link getInvalidMemberName}. */ private static invalidMemberHelper; /** * Returns the display name for a backend return code (e.g. * `ReturnCode.Ok` → `"Ok"`). */ static getReturnCodeName(returnCode: number): string; /** * Returns the display name for a request-type code (e.g. * `RequestType.Authenticate` → `"authenticate"`). * * The lowercased-first-letter convention matches the URL * segment the backend expects for the HTTP API, and the * matching index 0 in the socket frame produced by * {@link OperationHelper.toSocketData}. */ static getRequestTypeName(requestType: number): string; /** * Returns the display name for a request-role code (e.g. * `RequestRole.Client` → `"client"`). */ static getRequestRoleName(requestRole: number): string; /** * Returns the display name for an * {@link InvalidMemberType} value used by the validation * machinery on the response side. * * @param invalidMember Numeric value picked from the response * `invalidRequestParameters` array entry. * @returns The display name, or `"Unknown ()"` when the * value is not registered. */ static getInvalidMemberName(invalidMember: number): string; /** * Builds every lookup table. * * Called once from {@link GNNetwork.init} before any operation * is sent. Subsequent invocations rebuild every helper from * scratch — useful in test setups that reset the SDK between * cases. */ static init(): void; /** * Resets the return-code helper to a fresh instance and seeds * it from the canonical {@link ReturnCode} enum. */ private static setReturnCodeDic; /** * Adds entries from any enum-shaped object into the * return-code helper without lowercasing the first letter. * * Used by white-label deployments that ship additional return * codes — they call this method once after * {@link GNNetwork.init} with their own enum. * * @param returnCode Enum-shaped object whose entries should be * merged into the helper. */ static addReturnCodeDic(returnCode: any): void; /** * Resets the request-type helper to a fresh instance and seeds * it from the canonical {@link RequestType} enum. */ private static setRequestTypeDic; /** * Adds entries from any enum-shaped object into the * request-type helper, lowercasing the first letter so the * stored value matches the wire format * (`RequestType.Authenticate` → `"authenticate"`). * * @param requestType Enum-shaped object whose entries should * be merged into the helper. */ static addRequestTypeDic(requestType: any): void; /** * Resets the request-role helper to a fresh instance and seeds * it from the canonical {@link RequestRole} enum. */ private static setRequestRoleDic; /** * Adds entries from any enum-shaped object into the * request-role helper, lowercasing the first letter the same * way {@link addRequestTypeDic} does. * * @param requestRole Enum-shaped object whose entries should * be merged into the helper. */ static addRequestRoleDic(requestRole: any): void; /** * Resets the invalid-member helper to a fresh instance and * seeds it from the canonical {@link InvalidMemberType} enum. */ private static setInvalidMemberDic; /** * Adds entries from any enum-shaped object into the * invalid-member helper, lowercasing the first letter so the * stored value matches the human-readable form used in * validation log lines. * * @param invalidMember Enum-shaped object whose entries should * be merged into the helper. */ static addInvalidMemberDic(invalidMember: any): void; }