Skip to main content

Program

Extends

Implements

Constructors

new Program()

new Program(data?): Program

Creates a new class instance

Parameters

data?: IProgram

Returns

Program

Inherited from

Wrapper<ProgramSchema<UserSchema>, IProgram>.constructor

Source

src/lib/Wrapper.ts:36

new Program()

new Program(client, data?): Program

Parameters

client: Client

data?: IProgram

Returns

Program

Inherited from

Wrapper<ProgramSchema<UserSchema>, IProgram>.constructor

Source

src/lib/Wrapper.ts:37

Properties

author?

optional readonly author: User

The author of the program.

Implementation of

IProgram.author

Source

src/Program.ts:78


client?

optional client: Client

The client that this base was fetched with.

Inherited from

Wrapper.client

Source

src/lib/Wrapper.ts:15


code?

optional readonly code: string

The code of the program.

Implementation of

IProgram.code

Source

src/Program.ts:118


created?

optional readonly created: Date

The date the program was created.

Implementation of

IProgram.created

Source

src/Program.ts:82


deleted?

optional readonly deleted: boolean

Whether the program has been deleted.

Implementation of

IProgram.deleted

Source

src/Program.ts:147


description?

optional readonly description: null | string

The description of the program. Set to null if the description is empty string.

Implementation of

IProgram.description

Source

src/Program.ts:143


height?

optional readonly height: number

The height of the program in pixels.

Description

Constrained between 400 and 600. May be any value in between.

Implementation of

IProgram.height

Source

src/Program.ts:103


helpRequests?

optional readonly helpRequests: Question[]

Implementation of

IProgram.helpRequests

Source

src/Program.ts:164


hidden?

optional readonly hidden: boolean

Whether the program is hidden from the hotlist.

Implementation of

IProgram.hidden

Source

src/Program.ts:122


id?

optional readonly id: number

The ID of the program.

Implementation of

IProgram.id

Source

src/Program.ts:70


key?

optional readonly key: `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`

Implementation of

IProgram.key

Source

src/Program.ts:132


origin?

optional readonly origin: null | Program

The original program that this program is a spin-off of.

Implementation of

IProgram.origin

Source

src/Program.ts:131


questions?

optional readonly questions: Question[]

Implementation of

IProgram.questions

Source

src/Program.ts:163


rawData?

optional rawData: RecursivePartial<ProgramSchema<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>>

The raw base schema data

Remarks

Only set if the base was created from a user schema.

Inherited from

Wrapper.rawData

Source

src/lib/Wrapper.ts:22


selfFlagged?

optional readonly selfFlagged: boolean

Whether the program has been flagged by the client's authenticated user.

See

client

Implementation of

IProgram.selfFlagged

Source

src/Program.ts:154


selfVoted?

optional readonly selfVoted: boolean

Whether the program has been voted by the client's authenticated user.

See

client

Implementation of

IProgram.selfVoted

Source

src/Program.ts:160


spinOffCount?

optional readonly spinOffCount: number

The number of spin-offs the program has.

Implementation of

IProgram.spinOffCount

Source

src/Program.ts:114


thumbnailID?

optional readonly thumbnailID: number

The ID of the latest thumbnail image of the program.

Description

Previous thumbnails are not guaranteed to be available.

Implementation of

IProgram.thumbnailID

Source

src/Program.ts:139


tipsAndThanks?

optional readonly tipsAndThanks: TipsAndThanks[]

Implementation of

IProgram.tipsAndThanks

Source

src/Program.ts:162


title?

optional readonly title: string

The title of the program.

Implementation of

IProgram.title

Source

src/Program.ts:74


type?

optional readonly type: ProgramType

The type of program.

Implementation of

IProgram.type

Source

src/Program.ts:126


updated?

optional readonly updated: null | Date

The date the program was last updated.

Description

Set to null if the program has never been updated.

Implementation of

IProgram.updated

Source

src/Program.ts:89


votes?

optional readonly votes: number

The number of votes the program has received.

Description

Note that a program has 1 vote on creation.

Implementation of

IProgram.votes

Source

src/Program.ts:110


width?

optional readonly width: number

The height of the program in pixels.

Description

Constrained between 400 and 600. May be any value in between.

Implementation of

IProgram.width

Source

src/Program.ts:96


Type

static readonly Type: typeof ProgramType = ProgramType

Aliases for the program types.

Raw

ProgramRevisionSchema.editorType

Source

src/Program.ts:65

Accessors

lines

get lines(): null | number

Number of lines of code in the program.

Returns

null | number

Source

src/Program.ts:173


shortUrl

get shortUrl(): null | string

Short URL of the program.

Returns

null | string

Source

src/Program.ts:192


spinoff

get spinoff(): null | boolean

Returns

null | boolean

Source

src/Program.ts:166


thumbnailUrl

get thumbnailUrl(): null | string

Thumbnail image URL of the program.

Description

To get the latest thumbnail image, use 'latest' as the thumbnail ID instead.

Returns

null | string

Source

src/Program.ts:203


url

get url(): null | string

URL of the program.

Returns

null | string

Source

src/Program.ts:181

Methods

#resolveIdentifier()

private #resolveIdentifier(): number | `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`

Returns

number | `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`

Source

src/Program.ts:231


copy()

copy(data): Program

Updates data into the class

Parameters

data: IProgram

The data to copy from

Returns

Program

The class instance

Inherited from

Wrapper.copy

Source

src/lib/Wrapper.ts:53


copyFromSchema()

copyFromSchema(schema): Program

Updates data from a schema into the instance

Parameters

schema: RecursivePartial<ProgramSchema<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>>

The schema to copy from

Returns

Program

The class instance

Inherited from

Wrapper.copyFromSchema

Source

src/lib/Wrapper.ts:65


get()

get(client): Promise<Program>

Parameters

client: Client= undefined

Returns

Promise<Program>

Overrides

Wrapper.get

Source

src/Program.ts:325


getAllHelpRequests()

getAllHelpRequests(client, sort?): Promise<Program>

Parameters

client: Client= undefined

sort?: FeedbackSort

Returns

Promise<Program>

Source

src/Program.ts:405


getAllQuestions()

getAllQuestions(client, sort?): Promise<Program>

Parameters

client: Client= undefined

sort?: FeedbackSort

Returns

Promise<Program>

Source

src/Program.ts:377


getAllTipsAndThanks()

getAllTipsAndThanks(client, sort?): Promise<Program>

Parameters

client: Client= undefined

sort?: FeedbackSort

Returns

Promise<Program>

Source

src/Program.ts:349


getHelpRequests()

getHelpRequests(client, sort?): AsyncGenerator<Question[], Program, unknown>

Parameters

client: Client= undefined

sort?: FeedbackSort

Returns

AsyncGenerator<Question[], Program, unknown>

Source

src/Program.ts:389


getQuestions()

getQuestions(client, sort?): AsyncGenerator<Question[], Program, unknown>

Parameters

client: Client= undefined

sort?: FeedbackSort

Returns

AsyncGenerator<Question[], Program, unknown>

Source

src/Program.ts:361


getTipsAndThanks()

getTipsAndThanks(client, sort?): AsyncGenerator<TipsAndThanks[], Program, unknown>

Parameters

client: Client= undefined

sort?: FeedbackSort

Returns

AsyncGenerator<TipsAndThanks[], Program, unknown>

Source

src/Program.ts:333


is()

is(program): boolean

Parameters

program: IProgram

Returns

boolean

Overrides

Wrapper.is

Source

src/Program.ts:417


isSchema()

isSchema(schema): boolean

Checks if the schema represents the same instance

Parameters

schema: RecursivePartial<ProgramSchema<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>>

Returns

boolean

Inherited from

Wrapper.isSchema

Source

src/lib/Wrapper.ts:88


transformSchema()

transformSchema(schema): object

Parameters

schema: RecursivePartial<ProgramSchema<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>>

Returns

object

author

author: undefined | User

code

code: undefined | string = schema.revision.code

created

created: undefined | Date

deleted

deleted: undefined | boolean

description

description: undefined | null | string

height

height: undefined | number = schema.height

hidden

hidden: undefined | boolean = schema.hideFromHotlist

id

id: undefined | number

key

key: undefined | `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}` = schema.key

origin

origin: undefined | null | Program

selfFlagged

selfFlagged: undefined | boolean = schema.flaggedByUser

selfVoted

selfVoted: undefined | boolean = schema.upVoted

spinOffCount

spinOffCount: undefined | number

thumbnailID

thumbnailID: undefined | number

title

title: undefined | string = schema.translatedTitle

type

type: ProgramType

updated

updated: undefined | null | Date

votes

votes: undefined | number = schema.sumVotesIncremented

width

width: undefined | number = schema.width

Overrides

Wrapper.transformSchema

Source

src/Program.ts:238


fromIdentifier()

static fromIdentifier(identifier): Program

Parameters

identifier: ProgramID | `http${string}://${string}khanacademy.${string}/${string}/${string}/${number}` | `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`

Returns

Program

Source

src/Program.ts:219


fromSchema()

static fromSchema(schema): Program

Parameters

schema: RecursivePartial<ProgramSchema<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>>

Returns

Program

Source

src/Program.ts:211