Skip to content

Commit 7e70d8a

Browse files
committed
fix(cli): improve types
1 parent fc8b3a2 commit 7e70d8a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/cli/types/main.d.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { DevServerConfig } from '@web/dev-server';
22
import { CheckHtmlLinksCliOptions } from 'check-html-links/dist-types/types/main';
33
import { WatchOptions } from 'chokidar';
4-
export { ImagePreset, RocketPreset } from './preset';
4+
import { ImagePreset, RocketPreset } from './preset';
5+
export { ImagePreset, RocketPreset };
6+
import { Eleventy } from '@11ty/eleventy';
57

68
interface RocketStartConfig {
79
createSocialMediaImages?: boolean;
@@ -47,12 +49,12 @@ export interface RocketCliOptions extends Pick<RocketPreset, PresetKeys> {
4749
configFile?: string;
4850
outputDevDir?: string;
4951

50-
private _inputDirCwdRelative?: string;
51-
private _presetPaths?: string[];
52-
private __before11tyFunctions?: (() => void | Promise<void>)[];
52+
_inputDirCwdRelative?: string;
53+
_presetPaths?: string[];
54+
__before11tyFunctions?: (() => void | Promise<void>)[];
5355
}
5456

55-
export interface RocketPlugin {
57+
export type RocketPlugin = {
5658
// what can we do, typescript itself types the constructor as `Function`
5759
// eslint-disable-next-line @typescript-eslint/ban-types
5860
constructor: Function & { pluginName: string };
@@ -69,7 +71,8 @@ export interface RocketPlugin {
6971
data: any;
7072
eleventy: Eleventy;
7173
}): Promise<void>;
74+
} & {
7275
// later ts versions can do this
7376
// [index: `${string}Command`]: () => void|Promise<void>;
7477
[index: string]: () => void | Promise<void>;
75-
}
78+
};

0 commit comments

Comments
 (0)