refactor: import/export new architecture

This commit is contained in:
Andrew Bastin
2021-12-22 17:36:49 +05:30
parent b6e05d42f3
commit 681a957611
4 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import * as TE from "fp-ts/TaskEither"
import { HoppRESTRequest } from "@hoppscotch/data"
import { Collection } from "~/newstore/collections"
export type HoppExporter<T> = (content: T) => TE.TaskEither<string, string>
export type HoppExporterDefintion<T> = {
name: string
exporter: () => Promise<HoppExporter<T>>
}
export const RESTCollectionExporters: HoppExporterDefintion<
Collection<HoppRESTRequest>
>[] = [
{
name: "Hoppscotch REST Collection JSON",
exporter: () => import("./hopp").then((m) => m.default),
},
]