@imigueldiaz/mongodb-labeler
Version:
A MongoDB-based labeling system for content moderation with cryptographic signing
10 lines (9 loc) • 492 B
TypeScript
import type { FormattedLabel, SignedLabel, UnsignedLabel } from "./types.js";
export declare function formatLabel(label: UnsignedLabel & {
sig?: Uint8Array | {
$bytes: string;
};
}): FormattedLabel;
export declare function signLabel(label: UnsignedLabel, signingKey: Uint8Array): Promise<SignedLabel>;
export declare function labelIsSigned<T extends UnsignedLabel>(label: T): label is T & SignedLabel;
export declare function generateExpiration(daysFromNow?: number): string;