Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit b41c0be

Browse files
authored
Update typings to NodeCG version 1.9.0 (#3)
1 parent f7b7fa9 commit b41c0be

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nodecg-types",
3-
"version": "1.8.3",
3+
"version": "1.9.0",
44
"description": "Types from nodecg but without all the baggage and dependencies",
55
"homepage": "https://github.com/codeoverflow-org/nodecg-types#readme",
66
"repository": {

types/lib/config.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ export interface NodeCGConfig {
2626
clientID: string;
2727
scope: string;
2828
};
29+
discord?: {
30+
enabled: boolean;
31+
clientID: string;
32+
scope: string;
33+
};
2934
};
3035
ssl?: {
3136
enabled: boolean;

types/lib/nodecg-instance.d.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ interface NodeCGCommon<P extends Platform, M = SendMessageReturnType<P>> {
4949
handlerFunc: (message: any) => void
5050
): void;
5151
Replicant<V>(name: string, opts?: ReplicantOptions<V>): Replicant<V, P>;
52-
Replicant<V>(
53-
name: string,
54-
namespace: string,
55-
opts?: ReplicantOptions<V>
56-
): Replicant<V, P>;
52+
Replicant<V>(name: string, namespace: string, opts?: ReplicantOptions<V>): Replicant<V, P>;
53+
readReplicant<V>(name: string, cb: (value: V) => void): void;
54+
readReplicant<V>(name: string, namespace: string, cb: (value: V) => void): void;
5755
}
5856

5957
/**
@@ -69,15 +67,10 @@ export interface NodeCGServer extends NodeCGCommon<'server'> {
6967
extensions: {
7068
[bundleName: string]: (nodecg: NodeCGServer) => void;
7169
};
72-
listenFor(
73-
messageName: string,
74-
handlerFunc: (message: any, cb?: ListenForCb) => void
75-
): void;
76-
listenFor(
77-
messageName: string,
78-
bundleName: string,
79-
handlerFunc: (message: any, cb?: ListenForCb) => void
80-
): void;
70+
listenFor(messageName: string, handlerFunc: (message: any, cb?: ListenForCb) => void): void;
71+
listenFor(messageName: string, bundleName: string, handlerFunc: (message: any, cb?: ListenForCb) => void): void;
72+
readReplicant<V>(name: string): V;
73+
readReplicant<V>(name: string, namespace: string): V;
8174
}
8275

8376
/**
@@ -98,12 +91,6 @@ export interface NodeCGBrowser extends NodeCGCommon<'browser'> {
9891
): createjs.AbstractSoundInstance;
9992
stopSound(cueName: string): void;
10093
stopAllSounds(): void;
101-
readReplicant<V>(name: string, cb: (value: V) => void): void;
102-
readReplicant<V>(
103-
name: string,
104-
namespace: string,
105-
cb: (value: V) => void
106-
): void;
10794
}
10895

10996
/**

types/lib/replicant.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class ReplicantServer<V> extends ReplicantCommon<V> {
3030
}
3131

3232
export class ReplicantBrowser<V> extends ReplicantCommon<V> {
33-
static declareReplicants(): DeclaredReplicants<'browser'>;
33+
static declaredReplicants(): DeclaredReplicants<'browser'>;
3434
constructor(
3535
name: string,
3636
namespace: string,
@@ -72,7 +72,7 @@ export interface OperationQueueItem {
7272
* Declared replicant store object
7373
*/
7474
export interface DeclaredReplicants<P extends Platform> {
75-
[bundleName: string]: {[replicantName: string]: P};
75+
[bundleName: string]: {[replicantName: string]: Replicant<unknown, P>};
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)