Skip to content

Commit

Permalink
Added documentation links to interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lvcabral committed Jan 11, 2025
1 parent 1235f5e commit 4eef255
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 58 deletions.
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoAppMemoryMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { BrsType, RoMessagePort, toAssociativeArray } from "..";
import { Callable, StdlibArgument } from "../Callable";
import { Interpreter } from "../../interpreter";
import { Int32 } from "../Int32";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoAppMemoryMonitor extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoAudioPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { Callable, StdlibArgument } from "../Callable";
import { Interpreter } from "../../interpreter";
import { Int32 } from "../Int32";
import { DataType } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoAudioPlayer extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoCECStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { Callable } from "../Callable";
import { Interpreter } from "../../interpreter";
import { RoCECStatusEvent } from "./RoCECStatusEvent";
import { DataType } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoCECStatus extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoChannelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { RoChannelStoreEvent } from "./RoChannelStoreEvent";
import { RoAssociativeArray } from "./RoAssociativeArray";
import { AppData } from "../../common";
import { parseString, processors } from "xml2js";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoChannelStore extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoDeviceInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { RoDeviceInfoEvent } from "./RoDeviceInfoEvent";
import { RoAssociativeArray } from "./RoAssociativeArray";
import { RoArray } from "./RoArray";
import { ConnectionInfo, getRokuOSVersion, isPlatform } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";
import { v4 as uuidv4 } from "uuid";
import * as crypto from "crypto";
/// #if !BROWSER
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { Callable, StdlibArgument } from "../Callable";
import { Interpreter } from "../../interpreter";
import { FileSystem, getVolume, validUri, writeUri } from "../../interpreter/FileSystem";
import { RoList } from "./RoList";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";
import * as nanomatch from "nanomatch";
import * as path from "path";
export class RoFileSystem extends BrsComponent implements BrsValue {
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { BrsEvent, BrsType, RoInputEvent, RoMessagePort, toAssociativeArray } fr
import { Callable, StdlibArgument } from "../Callable";
import { Interpreter } from "../../interpreter";
import { BufferType, DataType } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoInput extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
rgbaIntToHex,
} from "../interfaces/IfDraw2D";
import { DataType, keyArraySpots, keyBufferSize, RemoteType } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoScreen extends BrsComponent implements BrsValue, BrsDraw2D {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoSystemLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { BrsEvent, BrsType, RoMessagePort, RoSystemLogEvent } from "..";
import { Callable, StdlibArgument } from "../Callable";
import { Interpreter } from "../../interpreter";
import { BufferType, DataType } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoSystemLog extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoURLTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { Int32 } from "../Int32";
import { RoURLEvent } from "./RoURLEvent";
import { RoAssociativeArray } from "./RoAssociativeArray";
import { audioExt, videoExt, getRokuOSVersion } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";
import fileType from "file-type";
/// #if !BROWSER
import { XMLHttpRequest } from "../../polyfill/XMLHttpRequest";
Expand Down
3 changes: 1 addition & 2 deletions src/core/brsTypes/components/RoVideoPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { Callable, StdlibArgument } from "../Callable";
import { Interpreter } from "../../interpreter";
import { Int32 } from "../Int32";
import { BufferType, DataType, MediaEvent } from "../../common";
import { IfSetMessagePort } from "../interfaces/IfSetMessagePort";
import { IfGetMessagePort } from "../interfaces/IfGetMessagePort";
import { IfSetMessagePort, IfGetMessagePort } from "../interfaces/IfMessagePort";

export class RoVideoPlayer extends BrsComponent implements BrsValue {
readonly kind = ValueKind.Object;
Expand Down
12 changes: 12 additions & 0 deletions src/core/brsTypes/interfaces/IfArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { Interpreter } from "../../interpreter";
import { BrsBoolean, BrsInvalid, ValueKind } from "../BrsType";
import { Callable, StdlibArgument } from "../Callable";

/**
* Interface IfArray
* https://developer.roku.com/docs/references/brightscript/interfaces/ifarray.md
*/
export class IfArray {
private readonly component: BrsComponent & BrsArray;
private readonly name: string;
Expand Down Expand Up @@ -152,6 +156,10 @@ export class IfArray {
});
}

/**
* Interface IfArrayGet
* https://developer.roku.com/docs/references/brightscript/interfaces/ifarrayget.md
*/
export class IfArrayGet {
readonly kind = ValueKind.Object;
private readonly component: BrsComponent & BrsArray;
Expand All @@ -171,6 +179,10 @@ export class IfArrayGet {
});
}

/**
* Interface IfArraySet
* https://developer.roku.com/docs/references/brightscript/interfaces/ifarrayset.md
*/
export class IfArraySet {
readonly kind = ValueKind.Object;
private readonly component: BrsComponent & BrsArray;
Expand Down
4 changes: 4 additions & 0 deletions src/core/brsTypes/interfaces/IfDraw2D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export type BrsCanvas = OffscreenCanvas | Canvas;
export type BrsCanvasContext2D = OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D;
export type BrsImageData = ImageData | NodeImageData;

/**
* Interface IFDraw2D
* https://developer.roku.com/docs/references/brightscript/interfaces/ifdraw2d.md
*/
export class IfDraw2D {
private readonly component: BrsDraw2D;

Expand Down
4 changes: 4 additions & 0 deletions src/core/brsTypes/interfaces/IfEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { Interpreter } from "../../interpreter";
import { BrsBoolean, BrsInvalid, ValueKind } from "../BrsType";
import { Callable } from "../Callable";

/**
* Interface IfEnum
* https://developer.roku.com/docs/references/brightscript/interfaces/ifenum.md
*/
export class IfEnum {
private readonly component: BrsIterable;

Expand Down
33 changes: 0 additions & 33 deletions src/core/brsTypes/interfaces/IfGetMessagePort.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/core/brsTypes/interfaces/IfList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { BrsBoolean, BrsInvalid, ValueKind } from "../BrsType";
import { Callable, StdlibArgument } from "../Callable";
import { BrsArray } from "./IfArray";

/**
* Interface IfList
* https://developer.roku.com/docs/references/brightscript/interfaces/iflist.md
*/
export class IfList {
private readonly component: BrsComponent & BrsList;

Expand Down Expand Up @@ -116,6 +120,10 @@ export class IfList {
});
}

/**
* Interface IfListToArray
* https://developer.roku.com/docs/references/brightscript/interfaces/iflisttoarray.md
*/
export class IfListToArray {
readonly kind = ValueKind.Object;
private readonly component: BrsComponent & BrsArray;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { Interpreter } from "../../interpreter";
import { BrsInvalid, ValueKind } from "../BrsType";
import { Callable, StdlibArgument } from "../Callable";
import { BrsComponent } from "../components/BrsComponent";
import { RoMessagePort } from "../components/RoMessagePort";

/**
* Interface IfSetMessagePort
* https://developer.roku.com/docs/references/brightscript/interfaces/ifsetmessageport.md
*/
export class IfSetMessagePort {
private readonly component: any;
private readonly callback?: Function;
Expand Down Expand Up @@ -33,7 +36,7 @@ export class IfSetMessagePort {
args: [new StdlibArgument("port", ValueKind.Dynamic)],
returns: ValueKind.Void,
},
impl: (_: Interpreter, port: RoMessagePort) => {
impl: (_, port: RoMessagePort) => {
return this.set(port);
},
});
Expand All @@ -43,8 +46,42 @@ export class IfSetMessagePort {
args: [new StdlibArgument("port", ValueKind.Dynamic)],
returns: ValueKind.Void,
},
impl: (_: Interpreter, port: RoMessagePort) => {
impl: (_, port: RoMessagePort) => {
return this.set(port);
},
});
}

/**
* Interface IfGetMessagePort
* https://developer.roku.com/docs/references/brightscript/interfaces/ifgetmessageport.md
*/
export class IfGetMessagePort {
private readonly component: any;

constructor(value: BrsComponent) {
this.component = value;
}

/** Returns the message port (if any) currently associated with the object */
readonly getMessagePort = new Callable("getMessagePort", {
signature: {
args: [],
returns: ValueKind.Object,
},
impl: (_) => {
return this.component.port ?? BrsInvalid.Instance;
},
});

/** Returns the message port (if any) currently associated with the object */
readonly getPort = new Callable("getPort", {
signature: {
args: [],
returns: ValueKind.Object,
},
impl: (_) => {
return this.component.port ?? BrsInvalid.Instance;
},
});
}
4 changes: 4 additions & 0 deletions src/core/brsTypes/interfaces/IfToStr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import { RuntimeError, RuntimeErrorDetail } from "../../Error";
import { Interpreter } from "../../interpreter";
import { vsprintf } from "sprintf-js";

/**
* Interface IfToStr
* https://developer.roku.com/docs/references/brightscript/interfaces/iftostr.md
*/
export class IfToStr {
private readonly component: BrsComponent;
private readonly defaultFormat?: string;
Expand Down

0 comments on commit 4eef255

Please sign in to comment.