mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-04 07:46:21 +02:00
29 lines
734 B
TypeScript
29 lines
734 B
TypeScript
import { HashDrivers } from '@ioc:Adonis/Core/Hash';
|
|
/**
|
|
* Expected shape of the config accepted by the "hashConfig"
|
|
* method
|
|
*/
|
|
declare type HashConfig = {
|
|
list: {
|
|
[name: string]: {
|
|
[K in keyof HashDrivers]: HashDrivers[K]['config'] & {
|
|
driver: K;
|
|
};
|
|
}[keyof HashDrivers];
|
|
};
|
|
};
|
|
/**
|
|
* Define config for the Hash module
|
|
*/
|
|
export declare function hashConfig<T extends HashConfig & {
|
|
default: keyof T['list'];
|
|
}>(config: T): T;
|
|
/**
|
|
* Pull hashers list from the config defined inside the "config/hash.ts"
|
|
* file
|
|
*/
|
|
export declare type InferListFromConfig<T extends HashConfig> = {
|
|
[K in keyof T['list']]: HashDrivers[T['list'][K]['driver']];
|
|
};
|
|
export {};
|