Skip to content

Commit

Permalink
feat: expose source and sourceOrigin class properties (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthova authored Mar 27, 2024
1 parent 4616621 commit f1590b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@discord/embedded-app-sdk",
"version": "1.0.3",
"version": "1.1.0",
"description": "@discord/embedded-app-sdk enables you to build rich, multiplayer experiences inside Discord.",
"author": "Discord",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export class DiscordSDK implements IDiscordSDK {
readonly guildId: string | null;
readonly channelId: string | null;
readonly configuration: SdkConfiguration;
readonly source: Window | WindowProxy | null = null;
readonly sourceOrigin: string = '';

private frameId: string;
private eventBus = new EventEmitter();
private source: Window | WindowProxy | null = null;
private sourceOrigin: string = '';
private isReady: boolean;
private pendingCommands: Map<
string,
Expand Down
2 changes: 2 additions & 0 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export interface IDiscordSDK {
readonly configuration: SdkConfiguration;
readonly channelId: string | null;
readonly guildId: string | null;
readonly source: Window | WindowProxy | null;
readonly sourceOrigin: string;

close(code: RPCCloseCodes, message: string): void;
subscribe<K extends keyof typeof EventSchema>(
Expand Down
3 changes: 3 additions & 0 deletions src/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export class DiscordSDKMock implements IDiscordSDK {
readonly platform = Platform.DESKTOP;
readonly instanceId = '123456789012345678';
readonly configuration = getDefaultSdkConfiguration();
readonly source: Window | WindowProxy | null = null;
readonly sourceOrigin: string = '';

private frameId = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa';
private eventBus = new EventEmitter();
public commands: IDiscordSDK['commands'];
Expand Down

0 comments on commit f1590b3

Please sign in to comment.