export enum ExternalizeErrorCode { /** Returned when passed a zero-length string. */ ZERO_LENGTH_STRING = 1, /** Returned when passed a non-two-byte encoded string. */ INVALID_STRING_ENCODING = 2, /** Returned when unable to convert a MaybeLocal to Local. */ TO_LOCAL_FAILURE = 3, /** Returned when IsExternal returns false. */ EXTERNALIZATION_FAILURE = 4, } /** * Returns the externalized string when it succeeds or an integer error code * otherwise. */ export function externalize(str: string): string | ExternalizeErrorCode; /** * Returns whether the passed string has previously been externalized. */ export function isExternal(str: string): boolean; /** * Returns the object associated with a given external string. Returns `null` * if the provided argument is not an externalized string or has no associated * data. */ export function getProperties( str: string, ): Record | null; /** * Returns a new, non-externalized string and prepares the previous for GC. */ export function internalize(str: string): string;