From fa6adedc42e9c6ec39cc30df16b54900c220b094 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Dec 2021 00:15:20 +0100 Subject: refactor: rewrite types and services I was repeating myself a lot in services. So I rewrited the different functions to improve readability and I extracted some formatting functions to put them in utils. I also rewrited/reorganized some types to keep consistent names. --- src/ts/types/pages.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/ts/types/pages.ts') diff --git a/src/ts/types/pages.ts b/src/ts/types/pages.ts index 4b38ff4..93ff62e 100644 --- a/src/ts/types/pages.ts +++ b/src/ts/types/pages.ts @@ -1,29 +1,23 @@ +import { ContentParts, Dates } from './app'; + export type Page = { content: string; - date: string; + dates: Dates; intro: string; - modified: string; title: string; }; export type RawPage = { - contentParts: { - afterMore: string; - beforeMore: string; - }; + contentParts: ContentParts; date: string; modified: string; title: string; }; -export type PageResponse = { +export type PageBy = { pageBy: RawPage; }; -export type FetchPageByUriReturn = (uri: string) => Promise; - -export type GetPageReturn = () => Promise; - export type PageProps = { page: Page; }; -- cgit v1.2.3