import { IError } from "ts-errorflow"; /** * Represents the data types which should logically be candidates for usage in * partition or clustering key queries. * * In the future this may diverge into two separate types * depending on usage patterns in the queries */ export declare type AllowedKeyTypes = string | number | Date; /** * Represents the generic set of unique key names that are valid based on the structure * from the supplied type of T */ export declare type CandidateKeys = { [K in keyof T]: T[K] extends AllowedKeyTypes ? K : never; }[keyof T]; /** * Represents the generic set of unique key names that are candidate selections for a Partition Key or * as part of a Composite Partition key based on the structure of the supplied type T */ export declare type PartitionKeys = CandidateKeys; /** * Represents the generic set of unique key names that are candidate selections for a Composite Key or * as part of a Composite Partition key based on the structure of the supplied type T */ export declare type ClusteringKeys = CandidateKeys; /** * Represents an object whose property keys must be selected from ones that could potentially be * partition keys on the target type T * * If ParititionKeys for a given T yielded 'tenantId' | 'applicationId' | 'entityId' * then the result of applying this against the same type T would be: * TODO: Comments of this nature belong in formal docs */ export declare type PartitionKeysFromType = Pick>; /** * Represents an object whose property keys are an optional subset of keys * designated as potential Partition Keys from type T */ export declare type PartitionKeyQuery = Partial>; /** * Represents an object whose property keys must be selected from ones that could potentially be * partition keys on the target type T * * If ParititionKeys for a given T yielded 'tenantId' | 'applicationId' | 'entityId' * then the result of applying this against the same type T would be: * TODO: Comments of this nature belong in formal docs */ export declare type ClusteringKeysFromType = Pick>; /** * Represents an object whose property keys are an optional subset of keys * designated as potential Partition Keys from type T */ export declare type ClusteringKeyQuery = Partial>; /** * Any type that can be accessed using x['someValue'] notation */ export declare type IndexableObject = { [index: string]: any; }; /** * An error that includes a message with some indication of what went wrong */ export interface AnError extends IError { message: string; } /** * A more specific error that includes a payload of information that may * be helpful in diagnosing what went wrong */ export interface ATypedError extends AnError { body: T; }