Skip to content

Commit

Permalink
Update typings to NodeCG version 1.9.0 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlxid authored Aug 7, 2022
1 parent f7b7fa9 commit b41c0be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodecg-types",
"version": "1.8.3",
"version": "1.9.0",
"description": "Types from nodecg but without all the baggage and dependencies",
"homepage": "https://github.com/codeoverflow-org/nodecg-types#readme",
"repository": {
Expand Down
5 changes: 5 additions & 0 deletions types/lib/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export interface NodeCGConfig {
clientID: string;
scope: string;
};
discord?: {
enabled: boolean;
clientID: string;
scope: string;
};
};
ssl?: {
enabled: boolean;
Expand Down
27 changes: 7 additions & 20 deletions types/lib/nodecg-instance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ interface NodeCGCommon<P extends Platform, M = SendMessageReturnType<P>> {
handlerFunc: (message: any) => void
): void;
Replicant<V>(name: string, opts?: ReplicantOptions<V>): Replicant<V, P>;
Replicant<V>(
name: string,
namespace: string,
opts?: ReplicantOptions<V>
): Replicant<V, P>;
Replicant<V>(name: string, namespace: string, opts?: ReplicantOptions<V>): Replicant<V, P>;
readReplicant<V>(name: string, cb: (value: V) => void): void;
readReplicant<V>(name: string, namespace: string, cb: (value: V) => void): void;
}

/**
Expand All @@ -69,15 +67,10 @@ export interface NodeCGServer extends NodeCGCommon<'server'> {
extensions: {
[bundleName: string]: (nodecg: NodeCGServer) => void;
};
listenFor(
messageName: string,
handlerFunc: (message: any, cb?: ListenForCb) => void
): void;
listenFor(
messageName: string,
bundleName: string,
handlerFunc: (message: any, cb?: ListenForCb) => void
): void;
listenFor(messageName: string, handlerFunc: (message: any, cb?: ListenForCb) => void): void;
listenFor(messageName: string, bundleName: string, handlerFunc: (message: any, cb?: ListenForCb) => void): void;
readReplicant<V>(name: string): V;
readReplicant<V>(name: string, namespace: string): V;
}

/**
Expand All @@ -98,12 +91,6 @@ export interface NodeCGBrowser extends NodeCGCommon<'browser'> {
): createjs.AbstractSoundInstance;
stopSound(cueName: string): void;
stopAllSounds(): void;
readReplicant<V>(name: string, cb: (value: V) => void): void;
readReplicant<V>(
name: string,
namespace: string,
cb: (value: V) => void
): void;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions types/lib/replicant.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ReplicantServer<V> extends ReplicantCommon<V> {
}

export class ReplicantBrowser<V> extends ReplicantCommon<V> {
static declareReplicants(): DeclaredReplicants<'browser'>;
static declaredReplicants(): DeclaredReplicants<'browser'>;
constructor(
name: string,
namespace: string,
Expand Down Expand Up @@ -72,7 +72,7 @@ export interface OperationQueueItem {
* Declared replicant store object
*/
export interface DeclaredReplicants<P extends Platform> {
[bundleName: string]: {[replicantName: string]: P};
[bundleName: string]: {[replicantName: string]: Replicant<unknown, P>};
}

/**
Expand Down

0 comments on commit b41c0be

Please sign in to comment.