import type NodeCG from 'nodecg/types'; import type { Schemas } from '../../types/index.js'; import { nodecg } from './nodecg.js'; // Wrapper for replicants that have a default (based on schema). function hasDefault(name: string) { return nodecg.Replicant(name) as unknown as NodeCG.default.ServerReplicantWithSchemaDefault; } // Wrapper for replicants that don't have a default (based on schema). // eslint-disable-next-line @typescript-eslint/no-unused-vars function hasNoDefault(name: string) { return nodecg.Replicant(name) as NodeCG.default.ServerReplicant; } /** * This is where you can declare all of your replicants to import easily into other files, * and to make sure they have any correct settings on startup. */ export const exampleReplicant = hasDefault('exampleReplicant'); export const playersReplicant = hasDefault('players'); export const scoreboardReplicant = hasDefault('scoreboard'); export const commentaryReplicant = nodecg.Replicant('commentary', { defaultValue: { leftCommentator: '', leftCommentatorTwitter: '', rightCommentator: '', rightCommentatorTwitter: '', }, persistent: false, });