aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-09-29 11:47:06 +0200
committerArmand Philippot <git@armandphilippot.com>2023-10-24 12:25:00 +0200
commit81b1e0e05919eb368a66aef47adcf7738af76f29 (patch)
tree758577d3f58d7025f84bca5bac9bc0da8432deb7 /src/types
parent3272ac336da52364ace5ed76d8f609d4088ffc06 (diff)
refactor(components): rewrite Spinner component
* Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position
Diffstat (limited to 'src/types')
-rw-r--r--src/types/app.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/types/app.ts b/src/types/app.ts
index 64bb3af..e237560 100644
--- a/src/types/app.ts
+++ b/src/types/app.ts
@@ -1,7 +1,7 @@
-import { NextPage } from 'next';
-import { AppProps as NextAppProps } from 'next/app';
-import { ReactElement, ReactNode } from 'react';
-import { MessageFormatElement } from 'react-intl';
+import type { NextPage } from 'next';
+import type { AppProps as NextAppProps } from 'next/app';
+import type { ReactElement, ReactNode } from 'react';
+import type { MessageFormatElement } from 'react-intl';
export type NextPageWithLayoutOptions = {
withExtraPadding?: boolean;
@@ -9,15 +9,15 @@ export type NextPageWithLayoutOptions = {
useGrid?: boolean;
};
-export type NextPageWithLayout<T = {}> = NextPage<T> & {
+export type NextPageWithLayout<T = object> = NextPage<T> & {
getLayout?: (
page: ReactElement,
options: NextPageWithLayoutOptions
) => ReactNode;
};
-// modified version - allows for custom pageProps type, falling back to 'any'
-type AppProps<P = any> = {
+// modified version - allows custom pageProps type, falling back to 'unknown'
+type AppProps<P = unknown> = {
pageProps: P;
} & Omit<NextAppProps<P>, 'pageProps'>;
@@ -130,3 +130,5 @@ export type Topic = Page<'topic'>;
export type Slug = {
slug: string;
};
+
+export type Position = 'bottom' | 'center' | 'left' | 'right' | 'top';