@dicebear/core 5.0.0-alpha.5 → 5.0.0-alpha.9
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/dist/index.d.ts +73 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +314 -466
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +320 -472
- package/dist/index.js.map +1 -0
- package/package.json +12 -6
- package/dist/core.d.ts +0 -3
- package/dist/index.umd.js +0 -8
- package/dist/options.d.ts +0 -18
- package/dist/types.d.ts +0 -54
- package/dist/utils/escape.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/options.d.ts +0 -2
- package/dist/utils/prng.d.ts +0 -2
- package/dist/utils/schema.d.ts +0 -5
- package/dist/utils/svg.d.ts +0 -38
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import * as JSONSchema from "json-schema";
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
interface Options {
|
|
8
|
+
seed?: string;
|
|
9
|
+
dataUri?: boolean;
|
|
10
|
+
flip?: boolean;
|
|
11
|
+
rotate?: number;
|
|
12
|
+
scale?: number;
|
|
13
|
+
radius?: number;
|
|
14
|
+
size?: number;
|
|
15
|
+
backgroundColor?: (string | string)[];
|
|
16
|
+
translateX?: number;
|
|
17
|
+
translateY?: number;
|
|
18
|
+
clip?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface Prng {
|
|
21
|
+
seed: string;
|
|
22
|
+
bool(likelihood?: number): boolean;
|
|
23
|
+
integer(min: number, max: number): number;
|
|
24
|
+
pick<T>(arr: T[]): T;
|
|
25
|
+
}
|
|
26
|
+
export type StyleSchema = JSONSchema.JSONSchema7;
|
|
27
|
+
export type StyleOptions<O extends {}> = Partial<O & Options>;
|
|
28
|
+
interface StyleCreateProps<O> {
|
|
29
|
+
prng: Prng;
|
|
30
|
+
options: StyleOptions<O>;
|
|
31
|
+
}
|
|
32
|
+
type StyleCreate<O extends {}> = (props: StyleCreateProps<O>) => StyleCreateResult;
|
|
33
|
+
interface StyleCreateResultAttributes {
|
|
34
|
+
viewBox: string;
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
}
|
|
37
|
+
interface StyleCreateResult {
|
|
38
|
+
attributes: StyleCreateResultAttributes;
|
|
39
|
+
body: string;
|
|
40
|
+
}
|
|
41
|
+
interface StylePreviewProps<O> {
|
|
42
|
+
prng: Prng;
|
|
43
|
+
options: StyleOptions<O>;
|
|
44
|
+
property: keyof StyleOptions<O>;
|
|
45
|
+
}
|
|
46
|
+
type StylePreview<O extends {}> = (props: StylePreviewProps<O>) => StylePreviewResult;
|
|
47
|
+
type StylePreviewResult = undefined | {
|
|
48
|
+
attributes: StyleCreateResultAttributes;
|
|
49
|
+
head?: string;
|
|
50
|
+
body: string;
|
|
51
|
+
};
|
|
52
|
+
interface StyleMeta {
|
|
53
|
+
title?: string;
|
|
54
|
+
creator?: string | string[];
|
|
55
|
+
source?: string;
|
|
56
|
+
license?: {
|
|
57
|
+
name: string;
|
|
58
|
+
url: string;
|
|
59
|
+
};
|
|
60
|
+
contributor?: string | string[];
|
|
61
|
+
}
|
|
62
|
+
export interface Style<O extends {}> {
|
|
63
|
+
meta: StyleMeta;
|
|
64
|
+
schema: StyleSchema;
|
|
65
|
+
create: StyleCreate<O>;
|
|
66
|
+
preview?: StylePreview<O>;
|
|
67
|
+
}
|
|
68
|
+
export function createPrng(seed?: string): Prng;
|
|
69
|
+
export function createAvatar<O extends {}>(style: Style<O>, options?: StyleOptions<O>): string;
|
|
70
|
+
export function createPreview<O extends {}>(style: Style<O>, options: StyleOptions<O>, property: keyof StyleOptions<O>): string | undefined;
|
|
71
|
+
export const schema: JSONSchema.JSONSchema7;
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";AACA;;;;GAIG;AAEH;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;ACdD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1C,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;CACtB;AAED,0BAA0B,WAAW,WAAW,CAAC;AAEjD,yBAAyB,CAAC,SAAS,EAAE,IAAI,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;AAE9D,2BAAkC,CAAC;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;CAC1B;AAED,iBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,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SAAS,EAAE,EACxC,KAAK,EAAE,MAAM,CAAC,CAAC,EACf,OAAO,EAAE,aAAa,CAAC,CAAC,EACxB,QAAQ,EAAE,MAAM,aAAa,CAAC,CAAC,GAC9B,MAAM,GAAG,SAAS,CAqCpB;AChFD,OAAA,MAAM,8BAAgD,CAAC","sources":["packages/@dicebear/core/src/src/options.ts","packages/@dicebear/core/src/src/types.ts","packages/@dicebear/core/src/src/utils/escape.ts","packages/@dicebear/core/src/src/utils/svg.ts","packages/@dicebear/core/src/src/utils/schema.ts","packages/@dicebear/core/src/src/utils/options.ts","packages/@dicebear/core/src/src/utils/prng.ts","packages/@dicebear/core/src/src/core.ts","packages/@dicebear/core/src/src/index.ts","packages/@dicebear/core/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,"/*!\n * DiceBear (@dicebear/core)\n *\n * Code licensed under MIT (https://github.com/dicebear/dicebear/blob/main/LICENSE)\n * Copyright (c) 2021 Florian Körner\n */\n\n// parcel bug workaround\nimport type * as JSONSchema from 'json-schema';\n// import type { JSONSchema7 } from 'json-schema';\nimport untypedSchema from './schema.json';\n\nconst schema = untypedSchema as JSONSchema.JSONSchema7;\n\nexport { schema };\nexport { createAvatar, createPreview } from './core';\nexport { create as createPrng } from './utils/prng';\nexport type { Prng, Style, StyleOptions, StyleSchema } from './types';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|