@hank.chat/types
Version:
42 lines (41 loc) • 1.55 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
/** A cron job to run a task at a scheduled interval in the background. */
export interface CronJob {
/**
* The cron schedule string to use for the cron job.
*
* Example (run every 5th minute):
* * /5 * * * *
*
* @see: https://crontab.guru/
*/
cron: string;
/** A function name to call for each scheduled cron execution. */
job: string;
}
export declare const CronJob: MessageFns<CronJob>;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
$case: string;
value: unknown;
} ? {
$case: T["$case"];
value?: DeepPartial<T["value"]>;
} : T extends {} ? {
[K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
type Exact<P, I extends P> = P extends Builtin ? P : P & {
[K in keyof P]: Exact<P[K], I[K]>;
} & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
export {};