Skip to content

Commit

Permalink
move story mode types
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Nov 18, 2023
1 parent a561306 commit a23697d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { BrowserContextOptions, Page } from 'playwright-core';
import z from 'zod';
import { loadProjectConfigFile, loadTSProjectConfigFile } from './configHelper';
import { log } from './log';
// import type { ShotMode } from './types';
import { ShotModeSchema } from './types';

const MaskSchema = z.object({
/**
Expand Down Expand Up @@ -181,14 +181,6 @@ const CustomShotsSchema = z.object({
currentShotsPath: z.string(),
});

const ShotModeSchema = z.enum([
'storybook',
'ladle',
'histoire',
'page',
'custom',
]);

const StoryLikeSchema = z.object({
shotMode: ShotModeSchema,
id: z.string().optional(),
Expand Down
11 changes: 10 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import z from 'zod';
import type { BrowserContextOptions } from 'playwright-core';

export type ShotMode = 'storybook' | 'ladle' | 'histoire' | 'page' | 'custom';
export const ShotModeSchema = z.enum([
'storybook',
'ladle',
'histoire',
'page',
'custom',
]);

export type ShotMode = z.infer<typeof ShotModeSchema>;

export type ShotItem = {
shotMode: ShotMode;
Expand Down

0 comments on commit a23697d

Please sign in to comment.