36 lines
708 B
TypeScript
36 lines
708 B
TypeScript
export interface PollProps {
|
|
userid: string | undefined,
|
|
activePollId: string,
|
|
pollData: PollData,
|
|
addOption: (name: string) => void,
|
|
vote: (optionName: string) => void
|
|
}
|
|
|
|
export interface PollListProps {
|
|
userid: string | undefined,
|
|
}
|
|
|
|
export interface PollData extends Record<string, SignedData<VoteData>[]> {
|
|
}
|
|
|
|
export interface SignedData<T> {
|
|
data: T,
|
|
signature: string
|
|
}
|
|
|
|
export interface VoteData {
|
|
userid: string,
|
|
timestamp: string
|
|
}
|
|
|
|
export interface OptionData {
|
|
userid: string,
|
|
timestamp: string,
|
|
optionName: string
|
|
}
|
|
|
|
export interface UserData {
|
|
userid: string,
|
|
private_key: CryptoKey | undefined,
|
|
public_key: CryptoKey | undefined
|
|
} |