Program
Extends
default
<ProgramSchema
<UserSchema
>,IProgram
>
Implements
Constructors
new Program()
new Program(
data
?):Program
Creates a new class instance
Parameters
• data?: IProgram
Returns
Inherited from
Wrapper<ProgramSchema<UserSchema>, IProgram>.constructor
Source
new Program()
new Program(
client
,data
?):Program
Parameters
• client: Client
• data?: IProgram
Returns
Inherited from
Wrapper<ProgramSchema<UserSchema>, IProgram>.constructor
Source
Properties
author?
optional
readonly
author:User
The author of the program.
Implementation of
Source
client?
optional
client:Client
The client that this base was fetched with.
Inherited from
Wrapper.client
Source
code?
optional
readonly
code:string
The code of the program.
Implementation of
Source
created?
optional
readonly
created:Date
The date the program was created.
Implementation of
Source
deleted?
optional
readonly
deleted:boolean
Whether the program has been deleted.
Implementation of
Source
description?
optional
readonly
description:null
|string
The description of the program. Set to null
if the description is empty string.
Implementation of
Source
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
Source
helpRequests?
optional
readonly
helpRequests:Question
[]
Implementation of
Source
hidden?
optional
readonly
hidden:boolean
Whether the program is hidden from the hotlist.
Implementation of
Source
id?
optional
readonly
id:number
The ID of the program.
Implementation of
Source
key?
optional
readonly
key: `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`
Implementation of
Source
origin?
optional
readonly
origin:null
|Program
The original program that this program is a spin-off of.
Implementation of
Source
questions?
optional
readonly
questions:Question
[]
Implementation of
Source
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
selfFlagged?
optional
readonly
selfFlagged:boolean
Whether the program has been flagged by the client's authenticated user.
See
Implementation of
Source
selfVoted?
optional
readonly
selfVoted:boolean
Whether the program has been voted by the client's authenticated user.
See
Implementation of
Source
spinOffCount?
optional
readonly
spinOffCount:number
The number of spin-offs the program has.
Implementation of
Source
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
Source
tipsAndThanks?
optional
readonly
tipsAndThanks:TipsAndThanks
[]
Implementation of
Source
title?
optional
readonly
title:string
The title of the program.
Implementation of
Source
type?
optional
readonly
type:ProgramType
The type of program.
Implementation of
Source
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
Source
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
Source
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
Source
Type
static
readonly
Type: typeofProgramType
=ProgramType
Aliases for the program types.
Raw
ProgramRevisionSchema.editorType
Source
Accessors
lines
get
lines():null
|number
Number of lines of code in the program.
Returns
null
| number
Source
shortUrl
get
shortUrl():null
|string
Short URL of the program.
Returns
null
| string
Source
spinoff
get
spinoff():null
|boolean
Returns
null
| boolean
Source
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
url
get
url():null
|string
URL of the program.
Returns
null
| string
Source
Methods
#resolveIdentifier()
private
#resolveIdentifier():number
| `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`
Returns
number
| `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`
Source
copy()
copy(
data
):Program
Updates data into the class
Parameters
• data: IProgram
The data to copy from
Returns
The class instance
Inherited from
Wrapper.copy
Source
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
The class instance
Inherited from
Wrapper.copyFromSchema
Source
get()
get(
client
):Promise
<Program
>
Parameters
• client: Client
= undefined
Returns
Promise
<Program
>
Overrides
Wrapper.get
Source
getAllHelpRequests()
getAllHelpRequests(
client
,sort
?):Promise
<Program
>
Parameters
• client: Client
= undefined
• sort?: FeedbackSort
Returns
Promise
<Program
>
Source
getAllQuestions()
getAllQuestions(
client
,sort
?):Promise
<Program
>
Parameters
• client: Client
= undefined
• sort?: FeedbackSort
Returns
Promise
<Program
>
Source
getAllTipsAndThanks()
getAllTipsAndThanks(
client
,sort
?):Promise
<Program
>
Parameters
• client: Client
= undefined
• sort?: FeedbackSort
Returns
Promise
<Program
>
Source
getHelpRequests()
getHelpRequests(
client
,sort
?):AsyncGenerator
<Question
[],Program
,unknown
>
Parameters
• client: Client
= undefined
• sort?: FeedbackSort
Returns
AsyncGenerator
<Question
[], Program
, unknown
>
Source
getQuestions()
getQuestions(
client
,sort
?):AsyncGenerator
<Question
[],Program
,unknown
>
Parameters
• client: Client
= undefined
• sort?: FeedbackSort
Returns
AsyncGenerator
<Question
[], Program
, unknown
>
Source
getTipsAndThanks()
getTipsAndThanks(
client
,sort
?):AsyncGenerator
<TipsAndThanks
[],Program
,unknown
>
Parameters
• client: Client
= undefined
• sort?: FeedbackSort
Returns
AsyncGenerator
<TipsAndThanks
[], Program
, unknown
>
Source
is()
is(
program
):boolean
Parameters
• program: IProgram
Returns
boolean
Overrides
Wrapper.is
Source
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
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
fromIdentifier()
static
fromIdentifier(identifier
):Program
Parameters
• identifier: ProgramID
| `http${string}://${string}khanacademy.${string}/${string}/${string}/${number}` | `ag5zfmtoYW4tYWNhZGVteXI${string}CxIKU2NyYXRjaHBhZB${string}${string}`
Returns
Source
fromSchema()
static
fromSchema(schema
):Program
Parameters
• schema: RecursivePartial
<ProgramSchema
<UserSchema
<AvatarSchema
, ProfileSchema
, ListProgramsSchema
<unknown
>>>>