-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.tsx
42 lines (38 loc) · 1 KB
/
types.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { type ReactNode } from 'react';
import {
type FieldError,
FieldErrors,
FieldErrorsImpl,
Merge,
} from 'react-hook-form';
export type FormValues = {
name: string;
email: string;
phone: string;
message: string;
[key: string]: string; // In this code, [key: string]: string; is an index signature. It tells TypeScript that FormValues can have any number of additional properties, as long as their keys are strings and their values are also strings. This allows you to access properties using a string key.
};
export type WindowWithDataLayer = Window & {
dataLayer: Record<string, any>[];
};
export type Tag = {
_id: string;
name: string;
slug?: string;
};
export type BlogType = {
title: string;
description?: string;
updatedAt: string;
createdAt: string;
slug: string;
tags: Tag[];
image: {
url: string;
alt: string;
width: number;
height: number;
public_id: string;
};
body?: string;
};