@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
29 lines (28 loc) • 979 B
text/typescript
import { KVAdapterInstance, KVIncrementCapability, KVNamespace } from "./types.mjs";
//#region src/libs/kv/utils.d.ts
declare const HASH_PREFIX: "h:";
type ResolveKeyOptions = {
maxKeyBytes?: number;
namespace?: KVNamespace;
};
/**
* Converts a namespace option into the literal prefix stored in the backing KV.
*/
declare const getNamespacePrefix: (namespace?: KVNamespace) => string;
/**
* Deterministically hash a key
*/
declare const hashKey: (key: string) => string;
/**
* Resolve the KV key
*/
declare const resolveKey: (key: string, options?: {
hash?: boolean;
}, resolveOptions?: number | ResolveKeyOptions) => string;
/**
* Type guard for adapters that provide provider-backed atomic increments.
*/
declare const supportsKVIncrement: (adapter: KVAdapterInstance) => adapter is KVAdapterInstance & KVIncrementCapability;
//#endregion
export { HASH_PREFIX, getNamespacePrefix, hashKey, resolveKey, supportsKVIncrement };
//# sourceMappingURL=utils.d.mts.map