import { type Base58, type Base58Keypair } from '@localfirst/crypto'; export declare const KeyType: { readonly GRAPH: "GRAPH"; readonly USER: "USER"; }; export type KeyType = (typeof KeyType)[keyof typeof KeyType]; /** * A KeyScope represents the scope of a keyset. For example: * - a user: `{type: USER, name: 'alice'}` * - a device: `{type: DEVICE, name: 'laptop'}` * - a role: `{type: ROLE, name: 'MANAGER'}` * - a single-use keyset: `{type: EPHEMERAL, name: EPHEMERAL}` */ export type KeyScope = { type: string; name: string; }; export type KeyMetadata = KeyScope & { generation: number; }; /** * A Keyset contains one secret key for symmetric encryption, as well as two keypairs, for * asymmetric encryption and signatures, respectively. * */ export type KeysetWithSecrets = KeyMetadata & { secretKey: Base58; encryption: Base58Keypair; signature: Base58Keypair; }; /** A Keyset contains the public encryption and signature keys from a KeysetWithSecrets */ export type Keyset = KeyMetadata & { encryption: Base58; signature: Base58; }; /** * A Keyring is a dictionary of keysets (including secrets), indexed by the public part of the * asymmetric encryption key * */ export type Keyring = Record; /** Keyset vs KeysetWithSecrets */ export declare const hasSecrets: (keys: Keyset | KeysetWithSecrets) => keys is KeysetWithSecrets; /** KeysetWithSecrets vs anything else */ export declare const isKeyset: (k: Record | Array>) => k is KeysetWithSecrets; /** Type guard: Keyring vs KeysetWithSecrets */ export declare const isKeyring: (k: Keyring | KeysetWithSecrets | KeysetWithSecrets[]) => k is Keyring; //# sourceMappingURL=types.d.ts.map