Modules Common Library / types
types
Classes
abstract glAnimation
Defined in: lib/modules-lib/src/types/index.ts:10
Represents an animation drawn using WebGL
Constructors
Constructor
new glAnimation(duration, fps): glAnimation;Defined in: lib/modules-lib/src/types/index.ts:11
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| Duration of the animation in seconds |
|
| Framerate in frames per second |
Returns
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
|
| Duration of the animation in seconds | ||
|
| Framerate in frames per second |
Accessors
_anim_symbol
Get Signature
get _anim_symbol(): typeof glAnimationSymbol;Defined in: lib/modules-lib/src/types/index.ts:30
Because of the way bundles and tabs are built, the tab and the bundle might end up with two separate instances of @sourceacademy/modules-lib bundled. Then there are two instances of the glAnimation class, so using an instanceof check no longer works properly.
Instead, we hide a special symbol which should be the same no matter which instance of glAnimation to perform the isAnimation check.
Returns
typeof glAnimationSymbol
Methods
[hasInstance]()
static hasInstance: boolean;Defined in: lib/modules-lib/src/types/index.ts:40
Because of some quirks in the way tabs and bundles are built, an instanceof check might fail at runtime. So we need to rewrite the instanceof check
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
boolean
getFrame()
abstract getFrame(timestamp): AnimFrame;Defined in: lib/modules-lib/src/types/index.ts:34
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
isAnimation()
static isAnimation(obj): obj is glAnimation;Defined in: lib/modules-lib/src/types/index.ts:45
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
obj is glAnimation
Interfaces
AnimFrame
Defined in: lib/modules-lib/src/types/index.ts:50
Properties
| Property | Type | Defined in |
|---|---|---|
( |
DebuggerContext
Defined in: lib/modules-lib/src/types/index.ts:61
DebuggerContext type used by frontend to assist typing information
Properties
| Property | Type | Defined in |
|---|---|---|
| ||
| ||
| ||
| ||
|
ModuleSideContent
Defined in: lib/modules-lib/src/types/index.ts:77
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
( | This function will be called to render the module tab in the side contents on Source Academy frontend. | ||
| BlueprintJS IconName element's name, used to render the icon which will be displayed in the side contents panel. See | ||
| The Tab's icon tooltip in the side contents on Source Academy frontend. | ||
( | This function will be called to determine if the component will be rendered |
ReplResult
Defined in: lib/modules-lib/node_modules/js-slang/dist/types.d.ts:22
Interface that custom Source objects can implement to override the default toString behaviour
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
() => |
| lib/modules-lib/node_modules/js-slang/dist/types.d.ts:26 |
Type Aliases
DeepPartial
type DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;Defined in: lib/modules-lib/src/types/index.ts:54
Type Parameters
| Type Parameter |
|---|
|
ModuleContexts
type ModuleContexts = Context["moduleContexts"];Defined in: lib/modules-lib/src/types/index.ts:69
ModuleTab
type ModuleTab = (props) => React.ReactNode;Defined in: lib/modules-lib/src/types/index.ts:75
Parameters
| Parameter | Type |
|---|---|
| { |
|
Returns
React.ReactNode