Files
portfolio2023/node_modules/@adonisjs/drive/build/config.d.ts
T
2023-11-24 22:35:41 +01:00

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 {};