From b41c0bed27a117fd7e5990887554f9104c7f51cf Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 7 Aug 2022 08:05:43 +0200 Subject: [PATCH] Update typings to NodeCG version 1.9.0 (#3) --- package.json | 2 +- types/lib/config.d.ts | 5 +++++ types/lib/nodecg-instance.d.ts | 27 +++++++-------------------- types/lib/replicant.d.ts | 4 ++-- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index f4c4b14..6972190 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/types/lib/config.d.ts b/types/lib/config.d.ts index a70ea4b..ce52fcc 100644 --- a/types/lib/config.d.ts +++ b/types/lib/config.d.ts @@ -26,6 +26,11 @@ export interface NodeCGConfig { clientID: string; scope: string; }; + discord?: { + enabled: boolean; + clientID: string; + scope: string; + }; }; ssl?: { enabled: boolean; diff --git a/types/lib/nodecg-instance.d.ts b/types/lib/nodecg-instance.d.ts index 7552a3b..202743a 100644 --- a/types/lib/nodecg-instance.d.ts +++ b/types/lib/nodecg-instance.d.ts @@ -49,11 +49,9 @@ interface NodeCGCommon

> { handlerFunc: (message: any) => void ): void; Replicant(name: string, opts?: ReplicantOptions): Replicant; - Replicant( - name: string, - namespace: string, - opts?: ReplicantOptions - ): Replicant; + Replicant(name: string, namespace: string, opts?: ReplicantOptions): Replicant; + readReplicant(name: string, cb: (value: V) => void): void; + readReplicant(name: string, namespace: string, cb: (value: V) => void): void; } /** @@ -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(name: string): V; + readReplicant(name: string, namespace: string): V; } /** @@ -98,12 +91,6 @@ export interface NodeCGBrowser extends NodeCGCommon<'browser'> { ): createjs.AbstractSoundInstance; stopSound(cueName: string): void; stopAllSounds(): void; - readReplicant(name: string, cb: (value: V) => void): void; - readReplicant( - name: string, - namespace: string, - cb: (value: V) => void - ): void; } /** diff --git a/types/lib/replicant.d.ts b/types/lib/replicant.d.ts index 5a6d3a6..30606a9 100644 --- a/types/lib/replicant.d.ts +++ b/types/lib/replicant.d.ts @@ -30,7 +30,7 @@ export class ReplicantServer extends ReplicantCommon { } export class ReplicantBrowser extends ReplicantCommon { - static declareReplicants(): DeclaredReplicants<'browser'>; + static declaredReplicants(): DeclaredReplicants<'browser'>; constructor( name: string, namespace: string, @@ -72,7 +72,7 @@ export interface OperationQueueItem { * Declared replicant store object */ export interface DeclaredReplicants

{ - [bundleName: string]: {[replicantName: string]: P}; + [bundleName: string]: {[replicantName: string]: Replicant}; } /**