mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 16:38:23 +01:00
drive-file
This commit is contained in:
parent
295ad35210
commit
59ac258272
1 changed files with 4 additions and 6 deletions
|
@ -4,14 +4,12 @@ import { Users, DriveFolders } from '../index';
|
||||||
import { User } from '@/models/entities/user';
|
import { User } from '@/models/entities/user';
|
||||||
import { toPuny } from '@/misc/convert-host';
|
import { toPuny } from '@/misc/convert-host';
|
||||||
import { awaitAll } from '@/prelude/await-all';
|
import { awaitAll } from '@/prelude/await-all';
|
||||||
import { SchemaType } from '@/misc/schema';
|
import { Packed } from '@/misc/schema';
|
||||||
import config from '@/config/index';
|
import config from '@/config/index';
|
||||||
import { query, appendQuery } from '@/prelude/url';
|
import { query, appendQuery } from '@/prelude/url';
|
||||||
import { Meta } from '@/models/entities/meta';
|
import { Meta } from '@/models/entities/meta';
|
||||||
import { fetchMeta } from '@/misc/fetch-meta';
|
import { fetchMeta } from '@/misc/fetch-meta';
|
||||||
|
|
||||||
export type PackedDriveFile = SchemaType<typeof packedDriveFileSchema>;
|
|
||||||
|
|
||||||
type PackOptions = {
|
type PackOptions = {
|
||||||
detail?: boolean,
|
detail?: boolean,
|
||||||
self?: boolean,
|
self?: boolean,
|
||||||
|
@ -99,12 +97,12 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||||
return parseInt(sum, 10) || 0;
|
return parseInt(sum, 10) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async pack(src: DriveFile['id'], options?: PackOptions): Promise<PackedDriveFile | null>;
|
public async pack(src: DriveFile['id'], options?: PackOptions): Promise<Packed<'DriveFile'> | null>;
|
||||||
public async pack(src: DriveFile, options?: PackOptions): Promise<PackedDriveFile>;
|
public async pack(src: DriveFile, options?: PackOptions): Promise<Packed<'DriveFile'>>;
|
||||||
public async pack(
|
public async pack(
|
||||||
src: DriveFile['id'] | DriveFile,
|
src: DriveFile['id'] | DriveFile,
|
||||||
options?: PackOptions
|
options?: PackOptions
|
||||||
): Promise<PackedDriveFile | null> {
|
): Promise<Packed<'DriveFile'> | null> {
|
||||||
const opts = Object.assign({
|
const opts = Object.assign({
|
||||||
detail: false,
|
detail: false,
|
||||||
self: false
|
self: false
|
||||||
|
|
Loading…
Reference in a new issue