diff --git a/schemas/players.json b/schemas/players.json new file mode 100644 index 0000000..c476cb0 --- /dev/null +++ b/schemas/players.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": false, + "properties": { + "gamertag": { + "type": "string", + "default": "" + }, + "team": { + "type": "string", + "default": "" + }, + "country": { + "type": "string", + "default": "" + }, + "twitter": { + "type": "string", + "default": "" + }, + "realName": { + "type": "string", + "default": "" + }, + "pronouns": { + "type": "string", + "default": "" + }, + "twitch": { + "type": "string", + "default": "" + }, + "notes": { + "type": "string", + "default": "" + } + }, + "required": [ + "gamertag", + "team", + "country", + "twitter", + "realName", + "pronouns", + "twitch", + "notes" + ] + }, + "default": {} +} diff --git a/src/browser_shared/replicants.ts b/src/browser_shared/replicants.ts index 761b3ef..bf58109 100644 --- a/src/browser_shared/replicants.ts +++ b/src/browser_shared/replicants.ts @@ -10,3 +10,4 @@ const thisBundle = 'nodecg-vue-ts-template'; * For more information see https://github.com/Dan-Shields/nodecg-vue-composable */ export const exampleReplicant = useReplicant('exampleReplicant', thisBundle); +export const playersReplicant = useReplicant('players', thisBundle); diff --git a/src/dashboard/example/views/Players.vue b/src/dashboard/example/views/Players.vue index 0601006..997132b 100644 --- a/src/dashboard/example/views/Players.vue +++ b/src/dashboard/example/views/Players.vue @@ -1,14 +1,376 @@ + + diff --git a/src/extension/util/replicants.ts b/src/extension/util/replicants.ts index de94f80..6cbefff 100644 --- a/src/extension/util/replicants.ts +++ b/src/extension/util/replicants.ts @@ -17,3 +17,4 @@ function hasNoDefault(name: string) { * and to make sure they have any correct settings on startup. */ export const exampleReplicant = hasDefault('exampleReplicant'); +export const playersReplicant = hasDefault('players'); diff --git a/src/types/schemas.d.ts b/src/types/schemas.d.ts index 3c27dfe..00eadf8 100644 --- a/src/types/schemas.d.ts +++ b/src/types/schemas.d.ts @@ -6,3 +6,4 @@ export type { Configschema } from './schemas/configschema.d.ts'; export type { ExampleReplicant } from './schemas/exampleReplicant.d.ts'; +export type { Players } from './schemas/players.d.ts'; diff --git a/src/types/schemas/players.d.ts b/src/types/schemas/players.d.ts new file mode 100644 index 0000000..51df0c0 --- /dev/null +++ b/src/types/schemas/players.d.ts @@ -0,0 +1,20 @@ +/* prettier-ignore */ +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface Players { + [k: string]: { + gamertag: string; + team: string; + country: string; + twitter: string; + realName: string; + pronouns: string; + twitch: string; + notes: string; + }; +}