Skip to content

Commit ead2032

Browse files
committed
format
1 parent 2a5b8e2 commit ead2032

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

packages/api/src/types.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,22 @@ const MessageContextTypeValue = {
4444
EDIT_CONTENT: "edit_content",
4545
} as const;
4646

47-
48-
type MessageContextBase<T extends typeof MessageContextTypeValue[keyof typeof MessageContextTypeValue]> = {
47+
type MessageContextBase<
48+
T extends
49+
(typeof MessageContextTypeValue)[keyof typeof MessageContextTypeValue],
50+
> = {
4951
type: T;
5052
endpoint: string;
51-
}
52-
export type MessageContextTypeNewContent = MessageContextBase<typeof MessageContextTypeValue.NEW_CONTENT> & { content: { id: null } };
53-
export type MessageContextTypeEditContent = MessageContextBase<typeof MessageContextTypeValue.EDIT_CONTENT> & { content: { id: string } };
54-
export type MessageContext = MessageContextTypeNewContent | MessageContextTypeEditContent;
53+
};
54+
export type MessageContextTypeNewContent = MessageContextBase<
55+
typeof MessageContextTypeValue.NEW_CONTENT
56+
> & { content: { id: null } };
57+
export type MessageContextTypeEditContent = MessageContextBase<
58+
typeof MessageContextTypeValue.EDIT_CONTENT
59+
> & { content: { id: string } };
60+
export type MessageContext =
61+
| MessageContextTypeNewContent
62+
| MessageContextTypeEditContent;
5563

5664
/**
5765
* microCMS から iFrame に対して onmessage のイベントで渡されるメッセージです。

0 commit comments

Comments
 (0)