-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FE): implement building block for encoding
- Loading branch information
Showing
3 changed files
with
162 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import type { ActivityFile } from './activity' | ||
|
||
export class DecodeResult { | ||
err: string | null = null | ||
activities: Array<ActivityFile> | ||
decodeTook: number | ||
serializationTook: number | ||
totalElapsed: number | ||
|
||
constructor(json?: any) { | ||
const casted = json as DecodeResult | ||
|
||
this.err = casted?.err | ||
this.activities = casted?.activities | ||
this.decodeTook = casted?.decodeTook | ||
this.serializationTook = casted?.serializationTook | ||
this.totalElapsed = casted?.totalElapsed | ||
} | ||
} | ||
|
||
export class EncodeResult { | ||
err: string | null = null | ||
encodeTook: number | ||
serializationTook: number | ||
totalElapsed: number | ||
fileName: string | ||
fileType: string | ||
fileBytes: Uint8Array | ||
|
||
constructor(data?: any) { | ||
const casted = data as EncodeResult | ||
this.err = casted?.err | ||
this.encodeTook = casted?.encodeTook | ||
this.serializationTook = casted?.serializationTook | ||
this.totalElapsed = casted?.totalElapsed | ||
this.fileName = casted?.fileName | ||
this.fileType = casted?.fileType | ||
this.fileBytes = casted?.fileBytes | ||
} | ||
} | ||
|
||
export class ManufacturerListResult { | ||
manufacturers: Manufacturer[] = [] | ||
|
||
constructor(data?: any) { | ||
const casted = data as ManufacturerListResult | ||
this.manufacturers = casted?.manufacturers | ||
} | ||
} | ||
|
||
export class Manufacturer { | ||
id: number = 0 | ||
name: string = '' | ||
products: Product[] = [] | ||
|
||
constructor(data?: any) { | ||
const casted = data as Manufacturer | ||
this.id = casted?.id | ||
this.name = casted?.name | ||
this.products = casted?.products | ||
} | ||
} | ||
|
||
export class Product { | ||
id: number = 0 | ||
name: string = '' | ||
|
||
constructor(data?: any) { | ||
const casted = data as Product | ||
this.id = casted?.id | ||
this.name = casted?.name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters