Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Resource

S222em edited this page May 13, 2023 · 51 revisions

Class: Resource<T>

Type parameters

Name Type
T extends ApiResourceType

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Resource<T>(bridge, data)

Type parameters

Name Type
T extends ApiResourceType

Parameters

Name Type
bridge Bridge
data ApiResourceTypeGet<T>

Defined in

src/structures/Resource.ts:60

Properties

bridge

Readonly bridge: Bridge

Defined in

src/structures/Resource.ts:48


data

data: ApiResourceTypeGet<T>

Defined in

src/structures/Resource.ts:50


type

Readonly Abstract type: ApiResourceType

Defined in

src/structures/Resource.ts:49

Accessors

id

get id(): string

Returns

string

Defined in

src/structures/Resource.ts:52


identifier

get identifier(): ResourceIdentifier<ApiResourceType>

Returns

ResourceIdentifier<ApiResourceType>

Defined in

src/structures/Resource.ts:56

Methods

_clone

_clone(): Resource<T>

Returns

Resource<T>

Defined in

src/structures/Resource.ts:73


_patch

_patch(data): void

Parameters

Name Type
data Partial<ApiResourceTypeGet<T>>

Returns

void

Defined in

src/structures/Resource.ts:69


_put

Protected _put(data): Promise<void>

Parameters

Name Type
data ApiResourceTypePut<T>

Returns

Promise<void>

Defined in

src/structures/Resource.ts:83


_update

_update(data): Resource<T>

Parameters

Name Type
data Partial<ApiResourceTypeGet<T>>

Returns

Resource<T>

Defined in

src/structures/Resource.ts:77


edit

Abstract edit(options): Promise<void>

Parameters

Name Type
options Record<string, any>

Returns

Promise<void>

Defined in

src/structures/Resource.ts:87


isType

isType<T>(type): this is NarrowResource<T>

Type parameters

Name Type
T extends ApiResourceType

Parameters

Name Type
type T

Returns

this is NarrowResource<T>

Defined in

src/structures/Resource.ts:65

hue.ts

Clone this wiki locally