Skip to content

Commit

Permalink
Update handraise and ballot slides types (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
av-alexistoledo authored Nov 17, 2023
1 parent 1d53f47 commit 3bbda9d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 27 deletions.
86 changes: 60 additions & 26 deletions lib/av_client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,42 +390,67 @@ 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 {
name: string
}

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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 3bbda9d

Please sign in to comment.