diff --git a/lib/av_client/types.ts b/lib/av_client/types.ts index ce3b8cfe..701d63ae 100644 --- a/lib/av_client/types.ts +++ b/lib/av_client/types.ts @@ -390,17 +390,18 @@ export interface ContestContent { subtitle?: LocalString question?: LocalString description?: LocalString + collapsable?: boolean + collapseDefault?: boolean + searchForm?: boolean + disregardVoterWeight?: boolean + randomizeOptions?: boolean markingType: MarkingType resultType: ResultType options: OptionContent[] identifiable?: boolean contestPositions?: ContestPositionMap - collapsable?: boolean; - collapseDefault?: boolean; - searchForm?: boolean; - disregardVoterWeight?: boolean; - randomizeOptions?: boolean; - blankOptionColor?: string; + blankOptionColor?: string + attachments?: Attachment[] } export interface ResultType { @@ -408,24 +409,48 @@ export interface ResultType { } export interface OptionContent { - reference: string; - code: number; - children?: OptionContent[]; - title: LocalString; - subtitle?: LocalString; - description?: LocalString; + reference: string + code: number + title: LocalString + subtitle?: LocalString + description?: LocalString + image?: string + selectable?: boolean + exclusive?: boolean + children?: OptionContent[] + parent?: ParentOption | null + ancestry?: string + position?: number + randomizeChildren?: boolean + accentColor?: string + url?: LocalString + videoUrl?: LocalString + voteLimit?: number writeIn?: { maxSize: number encoding: 'utf8' } - url?: LocalString; - videoUrl?: LocalString; - image?: string; - selectable?: boolean; - exclusive?: boolean; - voteLimit?: number; - accentColor?: string; - randomizeChildren?: boolean; +} + +export interface ParentOption { + reference: string + code: number + id: number + contest_id?: number + position?: number + ancestry?: string + data?: { + title: LocalString + image?: string | null + randomize_children?: boolean + accent_color?: string + description?: LocalString + } + created_at?: string + updated_at?: string + enabled?: boolean + exclusive?: boolean + selectable?: boolean } // Voting Round Config Item @@ -441,16 +466,20 @@ export interface VotingRoundConfig extends BaseBoardItem { export interface VotingRoundContent { reference: string status: "open" | "scheduled" | "closed" - resultPublicationDelay?: number + title?: LocalString + name?: string + contestReferences: string[] + identifiable?: boolean + demo?: boolean + handRaise?: boolean + contestPositions?: ContestPositionMap schedule?: { from: string to: string } - contestReferences: string[] - demo?: boolean - identifiable?: boolean - contestPositions?: ContestPositionMap; - handRaise?: boolean; + resultPublicationDelay?: number + recasting?: boolean + attachments?: Attachment[] } // Election Config Item @@ -541,6 +570,11 @@ export interface ExtractionConfirmations { attachment?: string } +export interface Attachment { + name: string + sha: string +} + // We define the client state to only require a subset of the electionConfig and voterSession // This enables us to do less setup in testing. // If any of the objects passed does not contain the required properties, then the build step will fail. diff --git a/package.json b/package.json index 7bfebea9..6747fdb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aion-dk/js-client", - "version": "3.1.13-alpha.4", + "version": "3.1.13-alpha.5", "license": "MIT", "description": "Assembly Voting JS client", "main": "dist/lib/av_client.js",