diff --git a/src/constants.ts b/src/constants.ts new file mode 100644 index 0000000..558c1db --- /dev/null +++ b/src/constants.ts @@ -0,0 +1,22 @@ +import { IGridLayout } from './state/interfaces/controls'; + +/** + * Offers constant information values to use in an application. + */ +export module InteractiveConstants { + export const gridLayoutSizes: IGridLayout[] = Object.freeze([ + { + size: 'large', + width: 80, + height: 20, + }, { + size: 'medium', + width: 45, + height: 25, + }, { + size: 'small', + width: 30, + height: 40, + }, + ]); +} diff --git a/src/index.ts b/src/index.ts index 78d796f..e5ba2d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,8 +5,9 @@ export * from './state/Group'; export * from './IClient'; export * from './GameClient'; export * from './ParticipantClient'; -export * from './util'; +export * from './constants'; export * from './errors'; +export * from './util'; /** * This allows you to specify which WebSocket implementation your diff --git a/src/state/interfaces/controls/IControl.ts b/src/state/interfaces/controls/IControl.ts index b1b9b7d..061f94e 100644 --- a/src/state/interfaces/controls/IControl.ts +++ b/src/state/interfaces/controls/IControl.ts @@ -8,6 +8,12 @@ import { IMeta } from './IMeta'; export type ControlKind = 'button' | 'joystick'; export type GridSize = 'large' | 'medium' | 'small'; +export interface IGridLayout { + readonly size: GridSize; + readonly width: number; + readonly height: number; +} + /** * Represents the raw data a control has when transmitted * and received over a socket connection.