@dicebear/core 5.0.0-alpha.2 → 5.0.0-alpha.24

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Florian Körner
3
+ Copyright (c) 2022 Florian Körner
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/lib/core.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { Result, Style, StyleOptions } from './types.js';
2
+ export declare function createAvatar<O extends {}>(style: Style<O>, options?: StyleOptions<O>): Result;
package/lib/core.js ADDED
@@ -0,0 +1,49 @@
1
+ import * as svgUtils from './utils/svg.js';
2
+ import { merge as mergeOptions } from './utils/options.js';
3
+ import { create as createPrng } from './utils/prng.js';
4
+ import * as license from './utils/license.js';
5
+ import { toFormat } from '@dicebear/converter';
6
+ export function createAvatar(style, options = {}) {
7
+ var _a, _b;
8
+ options = mergeOptions(style, options);
9
+ const prng = createPrng(options.seed);
10
+ const result = style.create({ prng: prng, options });
11
+ const backgroundColor = prng.pick((_a = options.backgroundColor) !== null && _a !== void 0 ? _a : []);
12
+ if (options.size) {
13
+ result.attributes.width = options.size.toString();
14
+ result.attributes.height = options.size.toString();
15
+ }
16
+ if (options.scale !== undefined && options.scale !== 100) {
17
+ result.body = svgUtils.addScale(result, options.scale);
18
+ }
19
+ if (options.flip) {
20
+ result.body = svgUtils.addFlip(result);
21
+ }
22
+ if (options.rotate) {
23
+ result.body = svgUtils.addRotate(result, options.rotate);
24
+ }
25
+ if (options.translateX || options.translateY) {
26
+ result.body = svgUtils.addTranslate(result, options.translateX, options.translateY);
27
+ }
28
+ if (backgroundColor && backgroundColor !== 'transparent') {
29
+ result.body = svgUtils.addBackgroundColor(result, backgroundColor);
30
+ }
31
+ if (options.radius || options.clip) {
32
+ result.body = svgUtils.addViewboxMask(result, (_b = options.radius) !== null && _b !== void 0 ? _b : 0);
33
+ }
34
+ const attributes = svgUtils.createAttrString(result.attributes);
35
+ const description = '<desc>Created with dicebear.com</desc>';
36
+ const metadata = license.xml(style);
37
+ const exif = license.exif(style);
38
+ const avatar = `<svg ${attributes}>${description}${metadata}${result.body}</svg>`;
39
+ return {
40
+ toString: () => avatar,
41
+ ...toFormat(avatar, 'svg'),
42
+ png: ({ includeExif = false }) => {
43
+ return toFormat(avatar, 'png', includeExif ? exif : undefined);
44
+ },
45
+ jpeg: ({ includeExif = false }) => {
46
+ return toFormat(avatar, 'jpeg', includeExif ? exif : undefined);
47
+ },
48
+ };
49
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * DiceBear (@dicebear/core)
3
+ *
4
+ * Code licensed under MIT (https://github.com/dicebear/dicebear/blob/main/LICENSE)
5
+ * Copyright (c) 2022 Florian Körner
6
+ */
7
+ export * from './core.js';
8
+ export * from './schema.js';
9
+ export * as license from './utils/license.js';
10
+ export * from './types.js';
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * DiceBear (@dicebear/core)
3
+ *
4
+ * Code licensed under MIT (https://github.com/dicebear/dicebear/blob/main/LICENSE)
5
+ * Copyright (c) 2022 Florian Körner
6
+ */
7
+ export * from './core.js';
8
+ export * from './schema.js';
9
+ export * as license from './utils/license.js';
10
+ export * from './types.js';
@@ -0,0 +1,2 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ export declare const schema: JSONSchema7;
package/lib/schema.js ADDED
@@ -0,0 +1,71 @@
1
+ export const schema = {
2
+ type: 'object',
3
+ $schema: 'http://json-schema.org/draft-07/schema#',
4
+ title: 'Options',
5
+ properties: {
6
+ seed: {
7
+ type: 'string',
8
+ examples: ['Jane Doe', 'John Doe'],
9
+ },
10
+ flip: {
11
+ type: 'boolean',
12
+ default: false,
13
+ examples: [true, false],
14
+ },
15
+ rotate: {
16
+ type: 'integer',
17
+ minimum: 0,
18
+ maximum: 360,
19
+ default: 0,
20
+ examples: [0, 45, 90, 135, 180, 225, 270, 315],
21
+ },
22
+ scale: {
23
+ type: 'integer',
24
+ minimum: 0,
25
+ maximum: 200,
26
+ default: 100,
27
+ examples: [50, 100, 150],
28
+ },
29
+ radius: {
30
+ type: 'integer',
31
+ minimum: 0,
32
+ maximum: 50,
33
+ default: 0,
34
+ examples: [0, 10, 20, 30, 40, 50],
35
+ },
36
+ size: {
37
+ type: 'integer',
38
+ minimum: 1,
39
+ examples: [128, 256, 512, 1024],
40
+ },
41
+ backgroundColor: {
42
+ type: 'array',
43
+ uniqueItems: true,
44
+ items: {
45
+ type: 'string',
46
+ pattern: '^([0-9a-zA-Z]+|#[a-fA-F0-9]{3}|#[a-fA-F0-9]{4}|#[a-fA-F0-9]{6}|#[a-fA-F0-9]{8})$',
47
+ },
48
+ examples: ['#FFD5DC', '#FFDFBF', '#C0EADE', '#B6E3F4', '#D1D4F9'],
49
+ },
50
+ translateX: {
51
+ type: 'integer',
52
+ minimum: -100,
53
+ maximum: 100,
54
+ default: 0,
55
+ examples: [-50, -25, 0, 25, 50],
56
+ },
57
+ translateY: {
58
+ type: 'integer',
59
+ minimum: -100,
60
+ maximum: 100,
61
+ default: 0,
62
+ examples: [-50, -25, 0, 25, 50],
63
+ },
64
+ clip: {
65
+ type: 'boolean',
66
+ default: true,
67
+ examples: [true, false],
68
+ },
69
+ },
70
+ additionalProperties: false,
71
+ };
@@ -1,54 +1,62 @@
1
- import type { JSONSchema7 } from 'json-schema';
2
- import type { Options } from './options';
3
- export interface Prng {
4
- seed: string;
5
- bool(likelihood?: number): boolean;
6
- integer(min: number, max: number): number;
7
- pick<T>(arr: T[]): T;
8
- }
9
- export declare type StyleSchema = JSONSchema7;
10
- export declare type StyleOptions<O extends {}> = Partial<O & Options>;
11
- export interface StyleCreateProps<O> {
12
- prng: Prng;
13
- options: StyleOptions<O>;
14
- }
15
- export declare type StyleCreate<O extends {}> = (props: StyleCreateProps<O>) => StyleCreateResult;
16
- export interface StyleCreateResultAttributes {
17
- viewBox: string;
18
- [key: string]: string;
19
- }
20
- export interface StyleCreateResult {
21
- attributes: StyleCreateResultAttributes;
22
- body: string;
23
- }
24
- export interface StylePreviewProps<O> {
25
- prng: Prng;
26
- options: StyleOptions<O>;
27
- property: keyof StyleOptions<O>;
28
- }
29
- export declare type StylePreview<O extends {}> = (props: StylePreviewProps<O>) => StylePreviewResult;
30
- export interface StylePreviewResultAttributes {
31
- viewBox: string;
32
- [key: string]: string;
33
- }
34
- export declare type StylePreviewResult = undefined | {
35
- attributes: StyleCreateResultAttributes;
36
- head?: string;
37
- body: string;
38
- };
39
- export interface StyleMeta {
40
- title?: string;
41
- creator?: string | string[];
42
- source?: string;
43
- license?: {
44
- name: string;
45
- url: string;
46
- };
47
- contributor?: string | string[];
48
- }
49
- export interface Style<O extends {}> {
50
- meta: StyleMeta;
51
- schema: StyleSchema;
52
- create: StyleCreate<O>;
53
- preview?: StylePreview<O>;
54
- }
1
+ import type { JSONSchema7 } from 'json-schema';
2
+ import type { Result as ConverterResult } from '@dicebear/converter';
3
+ export interface ResultConvertOptions {
4
+ includeExif?: boolean;
5
+ }
6
+ export interface Result extends ConverterResult {
7
+ png(options?: ResultConvertOptions): ConverterResult;
8
+ jpeg(options?: ResultConvertOptions): ConverterResult;
9
+ toString(): string;
10
+ }
11
+ export interface Options {
12
+ seed?: string;
13
+ flip?: boolean;
14
+ rotate?: number;
15
+ scale?: number;
16
+ radius?: number;
17
+ size?: number;
18
+ backgroundColor?: string[];
19
+ translateX?: number;
20
+ translateY?: number;
21
+ clip?: boolean;
22
+ }
23
+ export interface Exif {
24
+ [key: string]: string;
25
+ }
26
+ export declare type SchemaDefaults = Record<string, unknown>;
27
+ export interface Prng {
28
+ seed: string;
29
+ bool(likelihood?: number): boolean;
30
+ integer(min: number, max: number): number;
31
+ pick<T>(arr: T[]): T;
32
+ }
33
+ export declare type StyleSchema = JSONSchema7;
34
+ export declare type StyleOptions<O extends {}> = Partial<O & Options>;
35
+ export interface StyleCreateProps<O> {
36
+ prng: Prng;
37
+ options: StyleOptions<O>;
38
+ }
39
+ export declare type StyleCreate<O extends {}> = (props: StyleCreateProps<O>) => StyleCreateResult;
40
+ export interface StyleCreateResultAttributes {
41
+ viewBox: string;
42
+ [key: string]: string;
43
+ }
44
+ export interface StyleCreateResult {
45
+ attributes: StyleCreateResultAttributes;
46
+ body: string;
47
+ }
48
+ export interface StyleMeta {
49
+ title?: string;
50
+ source?: string;
51
+ creator?: string;
52
+ homepage?: string;
53
+ license?: {
54
+ name: string;
55
+ url: string;
56
+ };
57
+ }
58
+ export interface Style<O extends {}> {
59
+ meta: StyleMeta;
60
+ schema: StyleSchema;
61
+ create: StyleCreate<O>;
62
+ }
package/lib/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function xml(content: string): string;
2
+ export declare function md(content: string): string;
@@ -0,0 +1,12 @@
1
+ export function xml(content) {
2
+ return content
3
+ .replace(/&/g, '&amp;')
4
+ .replace(/'/g, '&apos;')
5
+ .replace(/"/g, '&quot;')
6
+ .replace(/</g, '&lt;')
7
+ .replace(/>/g, '&gt;');
8
+ }
9
+ export function md(content) {
10
+ const result = content.replace(/([\\`*_{}[\]()#+-.!])/g, '\\$1');
11
+ return xml(result);
12
+ }
@@ -0,0 +1,3 @@
1
+ import { Exif, Style } from '../types';
2
+ export declare function xml(style: Style<any>): string;
3
+ export declare function exif(style: Style<any>): Exif;
@@ -0,0 +1,51 @@
1
+ import * as _ from './escape.js';
2
+ export function xml(style) {
3
+ var _a, _b, _c, _d;
4
+ const xmlTitle = `<dc:title>${_.xml((_a = style.meta.title) !== null && _a !== void 0 ? _a : 'Unnamed')}</dc:title>`;
5
+ const xmlCreator = '<dc:creator>' +
6
+ `<cc:Agent rdf:about="${_.xml((_b = style.meta.homepage) !== null && _b !== void 0 ? _b : '')}">` +
7
+ `<dc:title>${_.xml((_c = style.meta.creator) !== null && _c !== void 0 ? _c : 'Unknown')}</dc:title>` +
8
+ '</cc:Agent>' +
9
+ '</dc:creator>';
10
+ const xmlSource = style.meta.source
11
+ ? `<dc:source>${_.xml(style.meta.source)}</dc:source>`
12
+ : '';
13
+ const xmlLicense = ((_d = style.meta.license) === null || _d === void 0 ? void 0 : _d.url)
14
+ ? `<cc:license rdf:resource="${_.xml(style.meta.license.url)}" />`
15
+ : '';
16
+ return ('<metadata' +
17
+ ' id="license"' +
18
+ ' xmlns:dc="http://purl.org/dc/elements/1.1/"' +
19
+ ' xmlns:cc="http://creativecommons.org/ns#"' +
20
+ ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' +
21
+ '<rdf:RDF>' +
22
+ '<cc:Work>' +
23
+ xmlTitle +
24
+ xmlCreator +
25
+ xmlSource +
26
+ xmlLicense +
27
+ '</cc:Work>' +
28
+ '</rdf:RDF>' +
29
+ '</metadata>');
30
+ }
31
+ export function exif(style) {
32
+ var _a, _b, _c, _d;
33
+ const title = (_a = style.meta.title) !== null && _a !== void 0 ? _a : 'Unnamed';
34
+ const creator = (_b = style.meta.creator) !== null && _b !== void 0 ? _b : 'Unknown';
35
+ let copyright = `"${title}" by "${creator}"`;
36
+ if ((_c = style.meta.license) === null || _c === void 0 ? void 0 : _c.name) {
37
+ copyright += ` is licensed under "${style.meta.license.name}".`;
38
+ }
39
+ const exif = {
40
+ Copyright: copyright,
41
+ 'XMP-dc:Title': title,
42
+ 'XMP-dc:Creator': creator,
43
+ };
44
+ if (style.meta.source) {
45
+ exif['XMP-dc:Source'] = style.meta.source;
46
+ }
47
+ if ((_d = style.meta.license) === null || _d === void 0 ? void 0 : _d.url) {
48
+ exif['XMP-cc:License'] = style.meta.license.url;
49
+ }
50
+ return exif;
51
+ }
@@ -0,0 +1,3 @@
1
+ import type { SchemaDefaults, Style, StyleOptions, StyleSchema } from '../types.js';
2
+ export declare function defaults(schema: StyleSchema): SchemaDefaults;
3
+ export declare function merge<O extends {}>(style: Style<O>, options: StyleOptions<O>): StyleOptions<O>;
@@ -0,0 +1,32 @@
1
+ import { schema } from '../schema.js';
2
+ export function defaults(schema) {
3
+ var _a;
4
+ let result = {};
5
+ let props = (_a = schema.properties) !== null && _a !== void 0 ? _a : {};
6
+ Object.keys(props).forEach((key) => {
7
+ let val = props[key];
8
+ if (typeof val === 'object' && undefined !== val.default) {
9
+ if (Array.isArray(val.default)) {
10
+ result[key] = [...val.default];
11
+ }
12
+ else if (typeof val.default === 'object') {
13
+ result[key] = { ...val.default };
14
+ }
15
+ else {
16
+ result[key] = val.default;
17
+ }
18
+ }
19
+ });
20
+ return result;
21
+ }
22
+ export function merge(style, options) {
23
+ let result = {
24
+ ...{
25
+ seed: Math.random().toString(),
26
+ },
27
+ ...defaults(schema),
28
+ ...defaults(style.schema),
29
+ ...options,
30
+ };
31
+ return result;
32
+ }
@@ -1,2 +1,2 @@
1
- import type { Prng } from '../types';
2
- export declare function create(seed?: string): Prng;
1
+ import type { Prng } from '../types.js';
2
+ export declare function create(seed?: string): Prng;
@@ -0,0 +1,39 @@
1
+ const MIN = -2147483648;
2
+ const MAX = 2147483647;
3
+ function xorshift(value) {
4
+ value ^= value << 13;
5
+ value ^= value >> 17;
6
+ value ^= value << 5;
7
+ return value;
8
+ }
9
+ function hashSeed(seed) {
10
+ let hash = 0;
11
+ for (let i = 0; i < seed.length; i++) {
12
+ hash = ((hash << 5) - hash + seed.charCodeAt(i)) | 0;
13
+ hash = xorshift(hash);
14
+ }
15
+ return hash;
16
+ }
17
+ function randomSeed() {
18
+ return MIN + Math.floor((MAX - MIN) * Math.random()).toString();
19
+ }
20
+ export function create(seed) {
21
+ seed = seed !== null && seed !== void 0 ? seed : randomSeed();
22
+ let value = hashSeed(seed) || 1;
23
+ const next = () => (value = xorshift(value));
24
+ const integer = (min, max) => {
25
+ return Math.floor(((next() - MIN) / (MAX - MIN)) * (max + 1 - min) + min);
26
+ };
27
+ return {
28
+ seed,
29
+ bool(likelihood = 50) {
30
+ return integer(0, 100) <= likelihood;
31
+ },
32
+ integer(min, max) {
33
+ return integer(min, max);
34
+ },
35
+ pick(arr) {
36
+ return arr[integer(0, arr.length - 1)];
37
+ },
38
+ };
39
+ }
@@ -0,0 +1,21 @@
1
+ import type { StyleCreateResult, StyleCreateResultAttributes } from '../types.js';
2
+ declare type CreateGroupProps = {
3
+ children: string;
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export declare function createGroup({ children, x, y }: CreateGroupProps): string;
8
+ export declare function getViewBox(result: StyleCreateResult): {
9
+ x: number;
10
+ y: number;
11
+ width: number;
12
+ height: number;
13
+ };
14
+ export declare function addBackgroundColor(result: StyleCreateResult, backgroundColor: string): string;
15
+ export declare function addScale(result: StyleCreateResult, scale: number): string;
16
+ export declare function addTranslate(result: StyleCreateResult, x?: number, y?: number): string;
17
+ export declare function addRotate(result: StyleCreateResult, rotate: number): string;
18
+ export declare function addFlip(result: StyleCreateResult): string;
19
+ export declare function addViewboxMask(result: StyleCreateResult, radius: number): string;
20
+ export declare function createAttrString(attributes: StyleCreateResultAttributes): string;
21
+ export {};
@@ -0,0 +1,57 @@
1
+ import * as escape from './escape.js';
2
+ export function createGroup({ children, x, y }) {
3
+ return `<g transform="translate(${x}, ${y})">${children}</g>`;
4
+ }
5
+ export function getViewBox(result) {
6
+ let viewBox = result.attributes['viewBox'].split(' ');
7
+ let x = parseInt(viewBox[0]);
8
+ let y = parseInt(viewBox[1]);
9
+ let width = parseInt(viewBox[2]);
10
+ let height = parseInt(viewBox[3]);
11
+ return {
12
+ x,
13
+ y,
14
+ width,
15
+ height,
16
+ };
17
+ }
18
+ export function addBackgroundColor(result, backgroundColor) {
19
+ let { width, height, x, y } = getViewBox(result);
20
+ return `<rect fill="${backgroundColor}" width="${width}" height="${height}" x="${x}" y="${y}" />${result.body}`;
21
+ }
22
+ export function addScale(result, scale) {
23
+ let { width, height, x, y } = getViewBox(result);
24
+ let percent = scale ? (scale - 100) / 100 : 0;
25
+ let translateX = (width / 2 + x) * percent * -1;
26
+ let translateY = (height / 2 + y) * percent * -1;
27
+ return `<g transform="translate(${translateX} ${translateY}) scale(${scale / 100})">${result.body}</g>`;
28
+ }
29
+ export function addTranslate(result, x, y) {
30
+ let viewBox = getViewBox(result);
31
+ let translateX = (viewBox.width + viewBox.x * 2) * ((x !== null && x !== void 0 ? x : 0) / 100);
32
+ let translateY = (viewBox.height + viewBox.y * 2) * ((y !== null && y !== void 0 ? y : 0) / 100);
33
+ return `<g transform="translate(${translateX} ${translateY})">${result.body}</g>`;
34
+ }
35
+ export function addRotate(result, rotate) {
36
+ let { width, height, x, y } = getViewBox(result);
37
+ return `<g transform="rotate(${rotate}, ${width / 2 + x}, ${height / 2 + y})">${result.body}</g>`;
38
+ }
39
+ export function addFlip(result) {
40
+ let { width, x } = getViewBox(result);
41
+ return `<g transform="scale(-1 1) translate(${width * -1 - x * 2} 0)">${result.body}</g>`;
42
+ }
43
+ export function addViewboxMask(result, radius) {
44
+ let { width, height, x, y } = getViewBox(result);
45
+ let rx = radius ? (width * radius) / 100 : 0;
46
+ let ry = radius ? (height * radius) / 100 : 0;
47
+ return (`<mask id="viewboxMask">` +
48
+ `<rect width="${width}" height="${height}" rx="${rx}" ry="${ry}" x="${x}" y="${y}" fill="#fff" />` +
49
+ `</mask>` +
50
+ `<g mask="url(#viewboxMask)">${result.body}</g>`);
51
+ }
52
+ export function createAttrString(attributes) {
53
+ attributes = { xmlns: 'http://www.w3.org/2000/svg', ...attributes };
54
+ return Object.keys(attributes)
55
+ .map((attr) => `${escape.xml(attr)}="${escape.xml(attributes[attr])}"`)
56
+ .join(' ');
57
+ }
package/package.json CHANGED
@@ -1,52 +1,50 @@
1
1
  {
2
2
  "name": "@dicebear/core",
3
- "version": "5.0.0-alpha.2",
3
+ "version": "5.0.0-alpha.24",
4
4
  "description": "An avatar library for designers and developers.",
5
5
  "keywords": [
6
6
  "avatar",
7
7
  "identicon"
8
8
  ],
9
- "homepage": "https://github.com/dicebear/dicebear/tree/master/packages/@dicebear/core",
9
+ "homepage": "https://dicebear.com",
10
10
  "bugs": {
11
11
  "url": "https://github.com/dicebear/dicebear/issues"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git@github.com:dicebear/dicebear.git",
16
- "directory": "/packages/@dicebear/core"
15
+ "url": "git+https://github.com/dicebear/dicebear.git"
17
16
  },
18
17
  "license": "MIT",
19
18
  "author": "Florian Körner <contact@florian-koerner.com>",
20
- "source": "src/index.ts",
21
- "main": "dist/index.js",
22
- "module": "dist/index.es.js",
23
- "browser": "dist/index.umd.js",
24
- "types": "dist/index.d.ts",
19
+ "type": "module",
20
+ "exports": "./lib/index.js",
21
+ "types": "./lib/index.d.ts",
25
22
  "files": [
26
23
  "LICENSE",
27
- "dist",
24
+ "lib",
28
25
  "README.md"
29
26
  ],
30
27
  "scripts": {
31
- "test": "jest",
28
+ "prebuild": "del-cli lib",
29
+ "build": "tsc",
32
30
  "prepublishOnly": "npm run build",
33
- "prebuild": "shx rm -rf dist",
34
- "build": "dicebear-project build DiceBear"
31
+ "test": "uvu tests"
35
32
  },
36
33
  "dependencies": {
34
+ "@dicebear/converter": "^5.0.0-alpha.24",
37
35
  "@types/json-schema": "^7.0.7"
38
36
  },
39
37
  "devDependencies": {
40
- "@tsconfig/recommended": "^1.0.0",
41
- "@types/jest": "^26.0.22",
42
- "dicebear-project": "^5.0.0-alpha.2",
43
- "jest": "^26.6.3",
44
- "shx": "^0.3.3",
45
- "ts-jest": "^26.5.4",
46
- "typescript": "^4.2.3"
38
+ "@tsconfig/recommended": "^1.0.1",
39
+ "del-cli": "^4.0.1",
40
+ "typescript": "^4.6.3",
41
+ "uvu": "^0.5.3"
42
+ },
43
+ "engines": {
44
+ "node": "^14.13.1 || >=16.0.0"
47
45
  },
48
46
  "publishConfig": {
49
47
  "access": "public"
50
48
  },
51
- "gitHead": "a29200fdf7cc9a6ddbb363c9b7f275844b005361"
49
+ "gitHead": "e54519daa65236ed864496663266f0bac5f06118"
52
50
  }
package/dist/core.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Style, StyleOptions } from './types';
2
- export declare function createAvatar<O extends {}>(style: Style<O>, options?: StyleOptions<O>): string;
3
- export declare function createPreview<O extends {}>(style: Style<O>, options: StyleOptions<O>, property: keyof StyleOptions<O>): string | undefined;
package/dist/index.d.ts DELETED
@@ -1,12 +0,0 @@
1
- /*!
2
- * DiceBear (@dicebear/core)
3
- *
4
- * Code licensed under MIT (https://github.com/dicebear/dicebear/blob/main/LICENSE)
5
- * Copyright (c) 2021 Florian Körner
6
- */
7
- import { JSONSchema7 } from 'json-schema';
8
- export declare const schema: JSONSchema7;
9
- export * from './core';
10
- export * from './types';
11
- export * from './options';
12
- export * as utils from './utils';