generated from templates/typescript-types
add some id and http types
This commit is contained in:
20
src/http.d.ts
vendored
Normal file
20
src/http.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
/** */
|
||||
export type HttpVerb
|
||||
= 'GET'
|
||||
| 'HEAD'
|
||||
| 'POST'
|
||||
| 'PUT'
|
||||
| 'DELETE'
|
||||
| 'OPTIONS'
|
||||
;
|
||||
|
||||
/** */
|
||||
export type HttpVerbExtended
|
||||
= HttpVerb
|
||||
| 'PATCH'
|
||||
| 'QUERY'
|
||||
| 'CONNECT'
|
||||
| 'TRACE'
|
||||
;
|
||||
|
6
src/identifiers.d.ts
vendored
Normal file
6
src/identifiers.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
export type HttpURL = `http://${string}` | `https://${string}`;
|
||||
|
||||
export type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
||||
|
||||
export type SnowflakeID = `${bigint}`;
|
4
src/index.d.ts
vendored
4
src/index.d.ts
vendored
@@ -1,2 +1,4 @@
|
||||
|
||||
export function hello() : string;
|
||||
export * from './http';
|
||||
export * from './identifiers';
|
||||
export * from './logger';
|
||||
|
19
src/logger.d.ts
vendored
Normal file
19
src/logger.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
// These types are based on / compatible with the pino Logger object
|
||||
|
||||
export interface LogFn {
|
||||
<T extends object>(obj: T, msg?: string, ...args: any[]): void;
|
||||
(obj: unknown, msg?: string, ...args: any[]): void;
|
||||
(msg: string, ...args: any[]): void;
|
||||
}
|
||||
|
||||
export interface Logger {
|
||||
child(bindings: Record<string, any>, options?: any): Logger;
|
||||
fatal: LogFn;
|
||||
error: LogFn;
|
||||
warn: LogFn;
|
||||
info: LogFn;
|
||||
debug: LogFn;
|
||||
trace: LogFn;
|
||||
silent: LogFn;
|
||||
}
|
Reference in New Issue
Block a user