advent-of-code-client
Version:
A NodeJS client for fetching inputs, running puzzle challenges and submitting answers to Advent Of Code directly from your JavaScript code.
44 lines (37 loc) • 714 B
text/typescript
declare global {
var aocDebug: boolean;
}
export type CacheKeyParams = {
year: number;
day: number;
token: string;
part: number;
};
export type Config = {
year: number;
day: number;
token: string;
/**
* @default true
*/
useCache?: boolean;
/**
* @default false
*/
debug?: boolean;
};
export type Cache = {
get: (key: string, options?: { ignoreMaxAge?: boolean }) => any;
set: (
key: string,
value: any,
options?: {
maxAge?: number;
version?: string;
}
) => void;
isExpired: (key: string) => boolean;
};
export type TransformFn = (input: string) => any;
export type Result = number | string;
export type PartFn = (input: any) => Result;