parent
0621237195
commit
118b31bd2f
@ -1,65 +1,30 @@
|
|||||||
export interface Modpack {
|
import type { z } from 'zod';
|
||||||
_id: string;
|
import type {
|
||||||
type: 'modpack';
|
diffDeleteSchema,
|
||||||
name: string;
|
diffSchema,
|
||||||
author: string;
|
diffSetSchema,
|
||||||
revisions: Revision[];
|
fileBlobSchema,
|
||||||
}
|
fileInlineSchema,
|
||||||
|
fileSchema,
|
||||||
export type Revision = RevisionBase | RevisionDiff;
|
fileTreeSchema,
|
||||||
|
folderSchema,
|
||||||
export interface RevisionBase {
|
modpackSchema,
|
||||||
id: string;
|
revisionBaseSchema,
|
||||||
tag?: RevisionTag;
|
revisionDiffSchema,
|
||||||
type: 'base';
|
revisionSchema,
|
||||||
tree: FileTree;
|
revisionTagSchema
|
||||||
}
|
} from './types-zod';
|
||||||
|
|
||||||
export interface RevisionDiff {
|
export type Modpack = z.infer<typeof modpackSchema>;
|
||||||
id: string;
|
export type Revision = z.infer<typeof revisionSchema>;
|
||||||
tag?: RevisionTag;
|
export type RevisionBase = z.infer<typeof revisionBaseSchema>;
|
||||||
type: 'diff';
|
export type RevisionDiff = z.infer<typeof revisionDiffSchema>;
|
||||||
tree: Diff[];
|
export type RevisionTag = z.infer<typeof revisionTagSchema>;
|
||||||
}
|
export type FileTree = z.infer<typeof fileTreeSchema>;
|
||||||
|
export type Folder = z.infer<typeof folderSchema>;
|
||||||
export interface RevisionTag {
|
export type File = z.infer<typeof fileSchema>;
|
||||||
type: 'alpha' | 'beta' | 'rc' | 'stable';
|
export type FileInline = z.infer<typeof fileInlineSchema>;
|
||||||
version: string;
|
export type FileBlob = z.infer<typeof fileBlobSchema>;
|
||||||
}
|
export type Diff = z.infer<typeof diffSchema>;
|
||||||
|
export type DiffSet = z.infer<typeof diffSetSchema>;
|
||||||
export type FileTree = Folder | File;
|
export type DiffDelete = z.infer<typeof diffDeleteSchema>;
|
||||||
|
|
||||||
export interface Folder {
|
|
||||||
type: 'folder';
|
|
||||||
children: Record<string, FileTree>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type File = FileInline | FileBlob;
|
|
||||||
|
|
||||||
export interface FileInline {
|
|
||||||
type: 'file';
|
|
||||||
inline: true;
|
|
||||||
content: string;
|
|
||||||
sha1: string;
|
|
||||||
sha512: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FileBlob {
|
|
||||||
type: 'file';
|
|
||||||
inline: false;
|
|
||||||
sha1: string;
|
|
||||||
sha512: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Diff = DiffSet | DiffDelete;
|
|
||||||
|
|
||||||
export interface DiffSet {
|
|
||||||
path: string[];
|
|
||||||
type: 'set';
|
|
||||||
value: FileTree;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DiffDelete {
|
|
||||||
path: string[];
|
|
||||||
type: 'delete';
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in new issue