@liner-fe/illust 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitignore ADDED
@@ -0,0 +1 @@
1
+ /lib
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @liner-fe/illust
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d9f0ee4: illust package 분리 및 prism ESM으로 마이그레이션
@@ -0,0 +1,19 @@
1
+ import { defineConfig } from 'tsup';
2
+ import { nodeExternalsPlugin } from 'esbuild-node-externals';
3
+
4
+ export default defineConfig({
5
+ entry: ['src/index.ts'],
6
+ outDir: 'lib',
7
+ // 이거는 무슨 옵션일까?
8
+ // splitting: false,
9
+ format: 'cjs',
10
+ bundle: true,
11
+ minify: false,
12
+ keepNames: true,
13
+ jsxFactory: 'React.createElement',
14
+ jsxFragment: 'Fragment',
15
+ tsconfig: './tsconfig.build.json',
16
+ platform: 'neutral',
17
+ dts: true,
18
+ esbuildPlugins: [nodeExternalsPlugin()],
19
+ });
package/lib/index.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ImageProps } from 'next/image';
3
+ import { Property } from 'csstype';
4
+
5
+ declare const illustNames: readonly ["hero-gift", "hero-search", "mini-approve", "mini-documents-2", "mini-documents-3", "mini-documents-4", "mini-documents-5", "mini-documents", "mini-egg", "mini-empty-message", "mini-empty", "mini-gift", "mini-graduation_hat", "mini-not-search", "mini-not-ticket-2", "mini-private", "mini-search", "mini-ticket", "mini-ticket-3", "mini-window", "spot-catch_star", "spot-clap", "spot-empty", "spot-gift", "spot-no_search", "spot-search-2", "spot-search-3", "spot-search-4", "spot-search-5", "spot-search", "spot-sign_up", "spot-team", "spot-write", "mini-sign", "mini-pots", "mini-erase", "mini-rocket"];
6
+ declare const darkIllustNames: readonly ["hero-gift", "hero-search", "mini-approve", "mini-documents-2", "mini-documents-3", "mini-documents-4", "mini-documents-5", "mini-documents", "mini-egg", "mini-empty-message", "mini-empty", "mini-gift", "mini-graduation_hat", "mini-not-search", "mini-not-ticket-2", "mini-private", "mini-search", "mini-ticket", "mini-ticket-3", "mini-window", "spot-catch_star", "spot-clap", "spot-empty", "spot-gift", "spot-no_search", "spot-search-2", "spot-search-3", "spot-search-4", "spot-search-5", "spot-search", "spot-sign_up", "spot-team", "spot-write", "mini-sign", "mini-pots", "mini-erase", "mini-rocket"];
7
+
8
+ type LightIllustType = (typeof illustNames)[number];
9
+ type DarkIllustType = (typeof darkIllustNames)[number];
10
+ type IllustType = DarkIllustType | LightIllustType;
11
+
12
+ interface Source<T extends false | true = true> {
13
+ name: IllustType;
14
+ inverse?: T;
15
+ }
16
+ interface IllustProps extends Omit<ImageProps, 'alt' | 'width' | 'height' | 'fill' | 'src'> {
17
+ width: number;
18
+ src: {
19
+ light: Source<false>;
20
+ dark?: Source;
21
+ };
22
+ margin?: Property.Margin<string>;
23
+ }
24
+ declare const Illust: (props: IllustProps) => react_jsx_runtime.JSX.Element;
25
+
26
+ declare const prefetchIllust: ({ name, isDark, }: {
27
+ name: IllustType;
28
+ isDark?: boolean;
29
+ }) => Promise<Response>;
30
+
31
+ export { Illust, type IllustProps, type Source, prefetchIllust };