Skip to content
Open

types #456

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Card/Statistics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { isoly } from "isoly"
import { Scheme } from "./Scheme"

export namespace Statistics {
export type Request = {
scheme: Scheme
range: isoly.DateRange
options?: { limit: number; cursor?: string }
}
export type Response = {
new: number
old: number
withTransaction: number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these property names are a bit unclear, could new and old be called eg. atStart and atEnd?

cursor?: string
}
}
2 changes: 2 additions & 0 deletions Card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Operation as CardOperation } from "./Operation"
import { Preset as CardPreset } from "./Preset"
import { Scheme as CardScheme } from "./Scheme"
import { Stack as CardStack } from "./Stack"
import { Statistics as CardStatistics } from "./Statistics"

export interface Card {
id: string
Expand Down Expand Up @@ -72,6 +73,7 @@ export namespace Card {
export import Operation = CardOperation
export import Scheme = CardScheme
export import Stack = CardStack
export import Statistics = CardStatistics
const csvMap: Record<string, (card: Card) => string | number | undefined> = {
id: card => card.id,
created: card => readableDate(card.created),
Expand Down