1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/usr/bin/env node
- import { buildIcons } from '../../.build/build-icons.mjs'
- const componentTemplate = ({
- name,
- namePascal,
- children
- }) => `\
- import createPreactComponent from '../createPreactComponent';
- export default createPreactComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
- const indexItemTemplate = ({
- name,
- namePascal
- }) => `export { default as ${namePascal} } from './icons/${name}';`
- const typeDefinitionsTemplate = () => `/// <reference types="preact" />
- import { JSX, RefObject } from 'preact'
- interface TablerIconsProps extends Partial<Omit<JSX.SVGAttributes, "ref" | "size">> {
- key?: string | number;
- ref?: string | ((component: any) => any) | RefObject<any>;
- color?: string
- size?: string | number
- }
- // Generated icons`
- const indexTypeTemplate = ({
- namePascal
- }) => `export declare const ${namePascal}: (props: TablerIconsProps) => JSX.Element;`
- buildIcons({
- name: 'icons-preact',
- componentTemplate,
- indexItemTemplate,
- typeDefinitionsTemplate,
- indexTypeTemplate
- })
|