mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-04 15:56:24 +02:00
29 lines
735 B
TypeScript
29 lines
735 B
TypeScript
import { DriversList } from '@ioc:Adonis/Core/Drive';
|
|
/**
|
|
* Expected shape of the config accepted by the "driveConfig"
|
|
* method
|
|
*/
|
|
declare type DriveConfig = {
|
|
disks: {
|
|
[name: string]: {
|
|
[K in keyof DriversList]: DriversList[K]['config'] & {
|
|
driver: K;
|
|
};
|
|
}[keyof DriversList];
|
|
};
|
|
};
|
|
/**
|
|
* Define config for AdonisJS drive
|
|
*/
|
|
export declare function driveConfig<T extends DriveConfig & {
|
|
disk: keyof T['disks'];
|
|
}>(config: T): T;
|
|
/**
|
|
* Pull disks from the config defined inside the "config/drive.ts"
|
|
* file
|
|
*/
|
|
export declare type InferDisksFromConfig<T extends DriveConfig> = {
|
|
[K in keyof T['disks']]: DriversList[T['disks'][K]['driver']];
|
|
};
|
|
export {};
|