Class: FileRef
Defined in: src/types.ts:15
A filename paired with a file hash or content.
ts
import { FileRef } from 'osu-files'
const file = new FileRef('background.jpg', { hash: 'a'.repeat(64) })
return { filename: file.filename, hash: file.hash }Constructors
new FileRef(
first,second?,ctx?):FileRef
Defined in: src/types.ts:20
Parameters
| Parameter | Type |
|---|---|
first | string | RealmFileLike | NamedFileUsageLike |
second? | string | { content?: Buffer<ArrayBufferLike>; hash?: string; } |
ctx? | { files: { get: { byHash: (h) => readonly RealmFileLike[]; }; }; } |
ctx.files? | { get: { byHash: (h) => readonly RealmFileLike[]; }; } |
ctx.files.get? | { byHash: (h) => readonly RealmFileLike[]; } |
ctx.files.get.byHash? | (h) => readonly RealmFileLike[] |
Returns
FileRef
ts
import { FileRef } from 'osu-files'
const file = new FileRef('background.jpg', { hash: 'a'.repeat(64) })
return { filename: file.filename, hash: file.hash }