Skip to content

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 ​

ParameterType
firststring | 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 }

Properties ​

content? ​

readonly optional content?: Buffer<ArrayBufferLike>

Defined in: src/types.ts:18


filename ​

readonly filename: string

Defined in: src/types.ts:16


hash? ​

readonly optional hash?: string

Defined in: src/types.ts:17

Released under the MIT License.