Skip to content

Commit

Permalink
feat: add typescript interfaces (#2)
Browse files Browse the repository at this point in the history
Add class structure
  • Loading branch information
aahna-ashina committed May 15, 2022
1 parent 083497e commit 05ec47e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
30 changes: 5 additions & 25 deletions server/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
export interface Pass {
organizationName: string;
passTypeIdentifier: string;
description: string;
teamIdentifier: string;
backgroundColor: string;
foregroundColor: string;
labelColor: string;
formatVersion: number;
storeCard: StoreCard;
barcodes: Barcode[];
export class Pass {

}

export interface Barcode {
message: string;
format: string;
messageEncoding: string;
}
export class ApplePass extends Pass {

export interface StoreCard {
headerFields: Field[];
primaryFields: any[];
secondaryFields: Field[];
}

export interface Field {
value: string;
label: string;
key: string;
fieldUUID?: string;
export class GooglePass extends Pass {

}
2 changes: 2 additions & 0 deletions server/pages/api/downloadPass.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ApplePass } from "../../interfaces";

// req = HTTP incoming message, res = HTTP server response
export default function handler(req, res) {
console.log('/api/downloadPass')
Expand Down

0 comments on commit 05ec47e

Please sign in to comment.