Skip to content

Commit

Permalink
Refactor types
Browse files Browse the repository at this point in the history
  • Loading branch information
eoftedal committed Mar 7, 2023
1 parent d9995d3 commit 6d9f33a
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export type Layer = {
type Descriptor = {
mediaType: string;
size: number;
digest: string;
};

export type Layer = Descriptor;

export type Image = {
path: string;
tag: string;
Expand All @@ -16,35 +18,24 @@ export type Index = {
schemaVersion: string;
manifests: Array<IndexManifest>;
annotations?: Map<string, string>;
}
};

export type IndexManifest = {
mediaType: string;
digest: string;
size: number;
export type IndexManifest = Descriptor & {
platform: Platform;
}
};

export type Platform = {
architecture: string;
os: string;
}
};

export type Manifest = {
config: {
digest: string;
mediaType: string;
size: number;
};
config: Descriptor;
mediaType: string;
layers: Array<Layer>;
};

export type PartialManifestConfig = {
digest?: string;
mediaType: string;
size: number;
};
export type PartialManifestConfig = Omit<Descriptor, "digest"> & Partial<Pick<Descriptor, "digest">>;

export type Config = {
architecture?: string;
Expand Down

0 comments on commit 6d9f33a

Please sign in to comment.