@react-native-vector-icons/common 0.0.1-alpha.20 → 0.0.1-alpha.23
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 +1 -2
- package/README.md +40 -182
- package/android/build.gradle +36 -2
- package/android/generated/java/com/reactnativevectoricons/common/NativeVectorIconsSpec.java +42 -0
- package/android/generated/jni/CMakeLists.txt +49 -0
- package/android/generated/jni/RNVectorIconsSpec-generated.cpp +38 -0
- package/android/generated/jni/RNVectorIconsSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h +24 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.h +17 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/Props.cpp +19 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/Props.h +18 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI-generated.cpp +40 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI.h +76 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.cpp +17 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h +23 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNVectorIconsSpec/States.h +19 -0
- package/android/src/main/AndroidManifestNew.xml +1 -1
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsModule.kt +90 -0
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsPackage.kt +35 -0
- package/android/src/newarch/VectorIconsSpec.kt +7 -0
- package/android/src/oldarch/VectorIconsSpec.kt +38 -0
- package/ios/VectorIcons.h +13 -17
- package/ios/VectorIcons.mm +21 -51
- package/ios/generated/RNVectorIconsSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/RNVectorIconsSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/RNVectorIconsSpec/EventEmitters.cpp +16 -0
- package/ios/generated/RNVectorIconsSpec/EventEmitters.h +17 -0
- package/ios/generated/RNVectorIconsSpec/Props.cpp +19 -0
- package/ios/generated/RNVectorIconsSpec/Props.h +18 -0
- package/ios/generated/RNVectorIconsSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/RNVectorIconsSpec/RNVectorIconsSpec-generated.mm +36 -0
- package/ios/generated/RNVectorIconsSpec/RNVectorIconsSpec.h +58 -0
- package/ios/generated/RNVectorIconsSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/RNVectorIconsSpec/ShadowNodes.h +23 -0
- package/ios/generated/RNVectorIconsSpec/States.cpp +16 -0
- package/ios/generated/RNVectorIconsSpec/States.h +19 -0
- package/ios/generated/RNVectorIconsSpecJSI-generated.cpp +40 -0
- package/ios/generated/RNVectorIconsSpecJSI.h +76 -0
- package/lib/commonjs/NativeVectorIcons.js.map +1 -1
- package/lib/commonjs/create-icon-set.js +48 -19
- package/lib/commonjs/create-icon-set.js.map +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js +92 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js.map +1 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.web.js +20 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.web.js.map +1 -0
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js +50 -0
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js.map +1 -0
- package/lib/commonjs/dynamicLoading/types.js +2 -0
- package/lib/commonjs/dynamicLoading/types.js.map +1 -0
- package/lib/commonjs/index.js +57 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/scripts/getFonts.js +1 -1
- package/lib/commonjs/scripts/updatePlist.js +1 -1
- package/lib/module/NativeVectorIcons.js +2 -0
- package/lib/module/NativeVectorIcons.js.map +1 -1
- package/lib/module/NativeVectorIcons.web.js +2 -0
- package/lib/module/NativeVectorIcons.web.js.map +1 -1
- package/lib/module/create-icon-set.js +49 -18
- package/lib/module/create-icon-set.js.map +1 -1
- package/lib/module/create-icon-source-cache.js +2 -0
- package/lib/module/create-icon-source-cache.js.map +1 -1
- package/lib/module/dynamicLoading/dynamic-font-loading.js +85 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.js.map +1 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.web.js +16 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.web.js.map +1 -0
- package/lib/module/dynamicLoading/dynamic-loading-setting.js +41 -0
- package/lib/module/dynamicLoading/dynamic-loading-setting.js.map +1 -0
- package/lib/module/dynamicLoading/types.js +2 -0
- package/lib/module/dynamicLoading/types.js.map +1 -0
- package/lib/module/ensure-native-module-available.js +2 -0
- package/lib/module/ensure-native-module-available.js.map +1 -1
- package/lib/module/index.js +33 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/scripts/common.js +2 -0
- package/lib/module/scripts/common.js.map +1 -1
- package/lib/module/scripts/getFonts.js +3 -1
- package/lib/module/scripts/getFonts.js.map +1 -1
- package/lib/module/scripts/updatePlist.js +3 -1
- package/lib/module/scripts/updatePlist.js.map +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeVectorIcons.d.ts +8 -0
- package/lib/typescript/commonjs/src/NativeVectorIcons.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeVectorIcons.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/create-icon-set.d.ts +36 -0
- package/lib/typescript/commonjs/src/create-icon-set.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/create-icon-source-cache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.d.ts +3 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.web.d.ts +6 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts +41 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/types.d.ts +9 -0
- package/lib/typescript/commonjs/src/dynamicLoading/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ensure-native-module-available.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/scripts/common.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/scripts/getFonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/scripts/updatePlist.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeVectorIcons.d.ts +8 -0
- package/lib/typescript/module/src/NativeVectorIcons.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeVectorIcons.web.d.ts +3 -0
- package/lib/typescript/module/src/NativeVectorIcons.web.d.ts.map +1 -0
- package/lib/typescript/module/src/create-icon-set.d.ts +36 -0
- package/lib/typescript/module/src/create-icon-set.d.ts.map +1 -0
- package/lib/typescript/module/src/create-icon-source-cache.d.ts +21 -0
- package/lib/typescript/module/src/create-icon-source-cache.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.d.ts +3 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.web.d.ts +6 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.web.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts +41 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/types.d.ts +9 -0
- package/lib/typescript/module/src/dynamicLoading/types.d.ts.map +1 -0
- package/lib/typescript/module/src/ensure-native-module-available.d.ts +2 -0
- package/lib/typescript/module/src/ensure-native-module-available.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +6 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/scripts/common.d.ts +2 -0
- package/lib/typescript/module/src/scripts/common.d.ts.map +1 -0
- package/lib/typescript/module/src/scripts/getFonts.d.ts +3 -0
- package/lib/typescript/module/src/scripts/getFonts.d.ts.map +1 -0
- package/lib/typescript/module/src/scripts/updatePlist.d.ts +3 -0
- package/lib/typescript/module/src/scripts/updatePlist.d.ts.map +1 -0
- package/package.json +66 -43
- package/react-native-vector-icons.podspec +26 -26
- package/react-native.config.js +12 -0
- package/src/NativeVectorIcons.ts +2 -4
- package/src/create-icon-set.tsx +79 -12
- package/src/dynamicLoading/dynamic-font-loading.ts +97 -0
- package/src/dynamicLoading/dynamic-font-loading.web.ts +15 -0
- package/src/dynamicLoading/dynamic-loading-setting.ts +77 -0
- package/src/dynamicLoading/types.ts +10 -0
- package/src/index.ts +48 -1
- package/src/scripts/getFonts.ts +1 -1
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsModule.java +0 -121
- package/android/src/main/java/com/reactnativevectoricons/common/VectorIconsPackage.java +0 -45
- package/android/src/newarch/VectorIconsSpec.java +0 -9
- package/android/src/oldarch/VectorIconsSpec.java +0 -18
- package/lib/typescript/src/NativeVectorIcons.d.ts +0 -9
- package/lib/typescript/src/NativeVectorIcons.d.ts.map +0 -1
- package/lib/typescript/src/NativeVectorIcons.web.d.ts.map +0 -1
- package/lib/typescript/src/create-icon-set.d.ts +0 -26
- package/lib/typescript/src/create-icon-set.d.ts.map +0 -1
- package/lib/typescript/src/create-icon-source-cache.d.ts.map +0 -1
- package/lib/typescript/src/ensure-native-module-available.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/scripts/common.d.ts.map +0 -1
- package/lib/typescript/src/scripts/getFonts.d.ts.map +0 -1
- package/lib/typescript/src/scripts/updatePlist.d.ts.map +0 -1
- /package/lib/typescript/{src → commonjs/src}/NativeVectorIcons.web.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/create-icon-source-cache.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/ensure-native-module-available.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/scripts/common.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/scripts/getFonts.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/scripts/updatePlist.d.ts +0 -0
package/src/create-icon-set.tsx
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import React, { forwardRef, type Ref } from 'react';
|
|
1
|
+
import React, { forwardRef, type Ref, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import { PixelRatio, Platform, Text, type TextProps, type TextStyle, processColor } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import NativeIconAPI from './NativeVectorIcons';
|
|
6
6
|
import createIconSourceCache from './create-icon-source-cache';
|
|
7
|
+
import { dynamicLoader } from './dynamicLoading/dynamic-font-loading';
|
|
8
|
+
import { isDynamicLoadingEnabled } from './dynamicLoading/dynamic-loading-setting';
|
|
9
|
+
import type { FontSource } from './dynamicLoading/types';
|
|
7
10
|
import ensureNativeModuleAvailable from './ensure-native-module-available';
|
|
8
11
|
|
|
9
12
|
export const DEFAULT_ICON_SIZE = 12;
|
|
10
13
|
export const DEFAULT_ICON_COLOR = 'black';
|
|
11
14
|
|
|
15
|
+
type ValueData = { uri: string; scale: number };
|
|
16
|
+
type GetImageSourceSyncIconFunc<GM> = (name: GM, size?: number, color?: TextStyle['color']) => ValueData | undefined;
|
|
17
|
+
type GetImageSourceIconFunc<GM> = (
|
|
18
|
+
name: GM,
|
|
19
|
+
size?: number,
|
|
20
|
+
color?: TextStyle['color'],
|
|
21
|
+
) => Promise<ValueData | undefined>;
|
|
22
|
+
|
|
12
23
|
export type IconProps<T> = TextProps & {
|
|
13
24
|
name: T;
|
|
14
25
|
size?: number;
|
|
@@ -16,20 +27,53 @@ export type IconProps<T> = TextProps & {
|
|
|
16
27
|
innerRef?: Ref<Text>;
|
|
17
28
|
};
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
type IconComponent<GM extends Record<string, number>> = React.FC<
|
|
31
|
+
TextProps & {
|
|
32
|
+
name: keyof GM;
|
|
33
|
+
size?: number;
|
|
34
|
+
color?: TextStyle['color'];
|
|
35
|
+
innerRef?: Ref<Text>;
|
|
36
|
+
} & React.RefAttributes<Text>
|
|
37
|
+
> & {
|
|
38
|
+
getImageSource: GetImageSourceIconFunc<keyof GM>;
|
|
39
|
+
getImageSourceSync: GetImageSourceSyncIconFunc<keyof GM>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type CreateIconSetOptions = {
|
|
43
|
+
postScriptName: string;
|
|
44
|
+
fontFileName: string;
|
|
45
|
+
fontSource?: FontSource;
|
|
46
|
+
fontStyle?: TextProps['style'];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function createIconSet<GM extends Record<string, number>>(
|
|
20
50
|
glyphMap: GM,
|
|
21
|
-
|
|
22
|
-
|
|
51
|
+
postScriptName: string,
|
|
52
|
+
fontFileName: string,
|
|
23
53
|
fontStyle?: TextProps['style'],
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
54
|
+
): IconComponent<GM>;
|
|
55
|
+
export function createIconSet<GM extends Record<string, number>>(
|
|
56
|
+
glyphMap: GM,
|
|
57
|
+
options: CreateIconSetOptions,
|
|
58
|
+
): IconComponent<GM>;
|
|
59
|
+
export function createIconSet<GM extends Record<string, number>>(
|
|
60
|
+
glyphMap: GM,
|
|
61
|
+
postScriptNameOrOptions: string | CreateIconSetOptions,
|
|
62
|
+
fontFileNameParam?: string,
|
|
63
|
+
fontStyleParam?: TextProps['style'],
|
|
64
|
+
): IconComponent<GM> {
|
|
65
|
+
const { postScriptName, fontFileName, fontStyle } =
|
|
66
|
+
typeof postScriptNameOrOptions === 'string'
|
|
67
|
+
? { postScriptName: postScriptNameOrOptions, fontFileName: fontFileNameParam, fontStyle: fontStyleParam }
|
|
68
|
+
: postScriptNameOrOptions;
|
|
69
|
+
|
|
70
|
+
const fontBasename = fontFileName ? fontFileName.replace(/\.(otf|ttf)$/, '') : postScriptName;
|
|
27
71
|
|
|
28
72
|
const fontReference = Platform.select({
|
|
29
|
-
windows: `/Assets/${
|
|
73
|
+
windows: `/Assets/${fontFileName}#${postScriptName}`,
|
|
30
74
|
android: fontBasename,
|
|
31
75
|
web: fontBasename,
|
|
32
|
-
default:
|
|
76
|
+
default: postScriptName,
|
|
33
77
|
});
|
|
34
78
|
|
|
35
79
|
const resolveGlyph = (name: keyof GM) => {
|
|
@@ -45,14 +89,37 @@ export const createIconSet = <GM extends Record<string, number>>(
|
|
|
45
89
|
const Icon = ({
|
|
46
90
|
name,
|
|
47
91
|
size = DEFAULT_ICON_SIZE,
|
|
48
|
-
color,
|
|
92
|
+
color = DEFAULT_ICON_COLOR,
|
|
49
93
|
style,
|
|
50
94
|
children,
|
|
51
95
|
allowFontScaling = false,
|
|
52
96
|
innerRef,
|
|
53
97
|
...props
|
|
54
98
|
}: IconProps<keyof GM>) => {
|
|
55
|
-
const
|
|
99
|
+
const [isFontLoaded, setIsFontLoaded] = React.useState(
|
|
100
|
+
isDynamicLoadingEnabled() ? dynamicLoader.isLoaded(fontReference) : true,
|
|
101
|
+
);
|
|
102
|
+
const glyph = isFontLoaded && name ? resolveGlyph(name) : '';
|
|
103
|
+
|
|
104
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the dependencies never change
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
let isMounted = true;
|
|
107
|
+
|
|
108
|
+
if (
|
|
109
|
+
!isFontLoaded &&
|
|
110
|
+
typeof postScriptNameOrOptions === 'object' &&
|
|
111
|
+
typeof postScriptNameOrOptions.fontSource !== 'undefined'
|
|
112
|
+
) {
|
|
113
|
+
dynamicLoader.loadFontAsync(fontReference, postScriptNameOrOptions.fontSource).finally(() => {
|
|
114
|
+
if (isMounted) {
|
|
115
|
+
setIsFontLoaded(true);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return () => {
|
|
120
|
+
isMounted = false;
|
|
121
|
+
};
|
|
122
|
+
}, []);
|
|
56
123
|
|
|
57
124
|
const styleDefaults = {
|
|
58
125
|
fontSize: size,
|
|
@@ -156,4 +223,4 @@ export const createIconSet = <GM extends Record<string, number>>(
|
|
|
156
223
|
});
|
|
157
224
|
|
|
158
225
|
return IconNamespace;
|
|
159
|
-
}
|
|
226
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The following imports are always present when react native is installed
|
|
3
|
+
* in the future, more explicit apis will be exposed by the core, including typings
|
|
4
|
+
* */
|
|
5
|
+
// @ts-expect-error missing types
|
|
6
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
7
|
+
import { getAssetByID } from '@react-native/assets-registry/registry';
|
|
8
|
+
import type { Image } from 'react-native';
|
|
9
|
+
// @ts-expect-error missing types
|
|
10
|
+
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
|
|
11
|
+
import { getErrorCallback } from './dynamic-loading-setting';
|
|
12
|
+
import type { DynamicLoader, FontSource } from './types';
|
|
13
|
+
|
|
14
|
+
const loadPromises: { [fontSource: string]: Promise<void> } = {};
|
|
15
|
+
|
|
16
|
+
const loadFontAsync = async (fontFamily: string, fontSource: FontSource): Promise<void> => {
|
|
17
|
+
const expoModules = globalThis?.expo?.modules;
|
|
18
|
+
if (!expoModules) {
|
|
19
|
+
throw new Error('Expo is not available. Dynamic font loading is not available.');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (loadPromises[fontFamily]) {
|
|
23
|
+
return loadPromises[fontFamily];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
loadPromises[fontFamily] = (async function LoadFont() {
|
|
27
|
+
try {
|
|
28
|
+
const localUri = await (() => {
|
|
29
|
+
if (typeof fontSource === 'string') {
|
|
30
|
+
// a local filesystem uri
|
|
31
|
+
return fontSource;
|
|
32
|
+
}
|
|
33
|
+
// a module id
|
|
34
|
+
const { uri, type, hash } = getLocalFontUrl(fontSource, fontFamily);
|
|
35
|
+
return expoModules.ExpoAsset.downloadAsync(uri, hash, type);
|
|
36
|
+
})();
|
|
37
|
+
|
|
38
|
+
await expoModules.ExpoFontLoader.loadAsync(fontFamily, localUri);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(`Failed to load font ${fontFamily}`, error); // eslint-disable-line no-console
|
|
41
|
+
|
|
42
|
+
getErrorCallback()?.({
|
|
43
|
+
error: error as Error,
|
|
44
|
+
fontFamily,
|
|
45
|
+
fontSource,
|
|
46
|
+
});
|
|
47
|
+
} finally {
|
|
48
|
+
delete loadPromises[fontFamily];
|
|
49
|
+
}
|
|
50
|
+
})();
|
|
51
|
+
|
|
52
|
+
return loadPromises[fontFamily];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type AssetRegistryEntry = {
|
|
56
|
+
name: string;
|
|
57
|
+
httpServerLocation: string;
|
|
58
|
+
hash: string;
|
|
59
|
+
type: string; // file extension
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const getLocalFontUrl = (fontModuleId: number, fontFamily: string) => {
|
|
63
|
+
const assetMeta: AssetRegistryEntry = getAssetByID(fontModuleId);
|
|
64
|
+
if (!assetMeta) {
|
|
65
|
+
throw new Error(`no asset found for font family "${fontFamily}", moduleId: ${String(fontModuleId)}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const resolver: typeof Image.resolveAssetSource = resolveAssetSource;
|
|
69
|
+
const assetSource = resolver(fontModuleId);
|
|
70
|
+
|
|
71
|
+
return { ...assetMeta, ...assetSource };
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const loadedFontsCache: { [name: string]: boolean } = {};
|
|
75
|
+
|
|
76
|
+
const isLoadedNative = (fontFamily: string) => {
|
|
77
|
+
if (fontFamily in loadedFontsCache) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const { expo } = globalThis;
|
|
82
|
+
if (!expo) {
|
|
83
|
+
throw new Error('Expo is not available. Dynamic font loading is not available.');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const loadedNativeFonts = expo.modules.ExpoFontLoader.getLoadedFonts();
|
|
87
|
+
loadedNativeFonts.forEach((font) => {
|
|
88
|
+
loadedFontsCache[font] = true;
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return fontFamily in loadedFontsCache;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const dynamicLoader: DynamicLoader = {
|
|
95
|
+
isLoaded: isLoadedNative,
|
|
96
|
+
loadFontAsync,
|
|
97
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dynamic font loading isn't supported on web
|
|
3
|
+
* */
|
|
4
|
+
import type { DynamicLoader, FontSource } from './types';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
const loadFontAsync = async (_fontFamily: string, _fontSource: FontSource): Promise<void> => undefined;
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
const isLoaded = (_fontFamily: string) => true;
|
|
11
|
+
|
|
12
|
+
export const dynamicLoader: DynamicLoader = {
|
|
13
|
+
isLoaded,
|
|
14
|
+
loadFontAsync,
|
|
15
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { FontSource } from './types';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface ExpoGlobal {
|
|
5
|
+
modules: {
|
|
6
|
+
ExpoAsset: {
|
|
7
|
+
// definition from
|
|
8
|
+
// https://github.com/expo/expo/blob/1f5a5991d14aad09282d1ce1612b44d30e7e7d3d/packages/expo-asset/ios/AssetModule.swift#L23
|
|
9
|
+
downloadAsync: (uri: string, hash: string | undefined, type: string) => Promise<string>;
|
|
10
|
+
};
|
|
11
|
+
ExpoFontLoader: {
|
|
12
|
+
// definition from
|
|
13
|
+
// https://github.com/expo/expo/blob/1f5a5991d14aad09282d1ce1612b44d30e7e7d3d/packages/expo-font/ios/FontLoaderModule.swift#L18
|
|
14
|
+
getLoadedFonts: () => string[];
|
|
15
|
+
loadAsync: (fontFamilyAlias: string, fileUri: string) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line vars-on-top
|
|
21
|
+
var expo: ExpoGlobal | undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const hasNecessaryExpoModules = !!globalThis.expo?.modules?.ExpoAsset && !!globalThis.expo?.modules?.ExpoFontLoader;
|
|
25
|
+
|
|
26
|
+
const hasNecessaryExpoFeatures =
|
|
27
|
+
hasNecessaryExpoModules && typeof globalThis.expo?.modules.ExpoFontLoader.getLoadedFonts === 'function';
|
|
28
|
+
|
|
29
|
+
let dynamicFontLoadingEnabled = hasNecessaryExpoFeatures;
|
|
30
|
+
|
|
31
|
+
export const isDynamicLoadingSupported = () => hasNecessaryExpoFeatures;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Set whether dynamic loading of fonts is enabled.
|
|
35
|
+
* Currently, the presence of Expo Asset and Font Loader modules is a prerequisite for enabling.
|
|
36
|
+
* In the future, React Native core apis will be used for dynamic font loading.
|
|
37
|
+
*
|
|
38
|
+
* @param value - whether dynamic loading of fonts is enabled
|
|
39
|
+
* @returns `true` if dynamic loading of fonts was successfully set. `false` otherwise.
|
|
40
|
+
* */
|
|
41
|
+
export const setDynamicLoadingEnabled = (value: boolean): boolean => {
|
|
42
|
+
if (!hasNecessaryExpoFeatures) {
|
|
43
|
+
if (process.env.NODE_ENV !== 'production' && !!value) {
|
|
44
|
+
const message = hasNecessaryExpoModules
|
|
45
|
+
? 'Expo is installed, but does not support dynamic font loading. Make sure to use Expo SDK 52 or newer.'
|
|
46
|
+
: 'Necessary Expo modules not found. Dynamic font loading is not available on Web or when necessary Expo modules are not present.';
|
|
47
|
+
console.error(message); // eslint-disable-line no-console
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
dynamicFontLoadingEnabled = !!value;
|
|
53
|
+
|
|
54
|
+
return true;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Whether dynamic loading of fonts is enabled.
|
|
59
|
+
* */
|
|
60
|
+
export const isDynamicLoadingEnabled = () => dynamicFontLoadingEnabled;
|
|
61
|
+
|
|
62
|
+
type ErrorCallback = (args: {
|
|
63
|
+
error: Error;
|
|
64
|
+
fontFamily: string;
|
|
65
|
+
fontSource: FontSource;
|
|
66
|
+
}) => void;
|
|
67
|
+
|
|
68
|
+
let dynamicLoadingErrorCallback: undefined | ErrorCallback;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Set a callback to be called when an error occurs during dynamic font loading.
|
|
72
|
+
* */
|
|
73
|
+
export const setDynamicLoadingErrorCallback = (callback: ErrorCallback) => {
|
|
74
|
+
dynamicLoadingErrorCallback = callback;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const getErrorCallback = () => dynamicLoadingErrorCallback;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// the result of calling require('path')
|
|
2
|
+
type ModuleId = number;
|
|
3
|
+
type LocalFileSystemUri = string;
|
|
4
|
+
|
|
5
|
+
export type FontSource = ModuleId | LocalFileSystemUri;
|
|
6
|
+
|
|
7
|
+
export type DynamicLoader = {
|
|
8
|
+
loadFontAsync: (fontFamily: string, fontSource: FontSource) => Promise<void>;
|
|
9
|
+
isLoaded: (fontFamily: string) => boolean;
|
|
10
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
1
3
|
export { createIconSet, DEFAULT_ICON_SIZE, DEFAULT_ICON_COLOR } from './create-icon-set';
|
|
2
|
-
export type { IconProps } from './create-icon-set';
|
|
4
|
+
export type { IconProps, CreateIconSetOptions } from './create-icon-set';
|
|
5
|
+
export {
|
|
6
|
+
setDynamicLoadingEnabled,
|
|
7
|
+
isDynamicLoadingEnabled,
|
|
8
|
+
isDynamicLoadingSupported,
|
|
9
|
+
setDynamicLoadingErrorCallback,
|
|
10
|
+
} from './dynamicLoading/dynamic-loading-setting';
|
|
11
|
+
|
|
12
|
+
const LINKING_ERROR = `
|
|
13
|
+
The package '@react-native-vector-icons/common' doesn't seem to be linked. Make sure:
|
|
14
|
+
${Platform.select({ ios: "- You have run 'pod install'\n", default: '' })}
|
|
15
|
+
- You rebuilt the app after installing the package\n'
|
|
16
|
+
- You are not using Expo Go
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
// @ts-expect-error : NativeModules type is incomplete
|
|
20
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null; // eslint-disable-line no-underscore-dangle
|
|
21
|
+
|
|
22
|
+
const VectorIconsModule = isTurboModuleEnabled
|
|
23
|
+
? require('./NativeVectorIcons').default // eslint-disable-line @typescript-eslint/no-require-imports
|
|
24
|
+
: NativeModules.VectorIcons;
|
|
25
|
+
|
|
26
|
+
const VectorIcons = VectorIconsModule
|
|
27
|
+
? VectorIconsModule
|
|
28
|
+
: new Proxy(
|
|
29
|
+
{},
|
|
30
|
+
{
|
|
31
|
+
get() {
|
|
32
|
+
throw new Error(LINKING_ERROR);
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// TODO: Do we want to expose this as a public API?
|
|
38
|
+
export function getImageForFont(
|
|
39
|
+
fontFamilyName: string,
|
|
40
|
+
glyph: string,
|
|
41
|
+
fontSize: number,
|
|
42
|
+
color: number,
|
|
43
|
+
): Promise<string> {
|
|
44
|
+
return VectorIcons.getImageForFont(fontFamilyName, glyph, fontSize, color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getImageForFontSync(fontFamilyName: string, glyph: string, fontSize: number, color: number): string {
|
|
48
|
+
return VectorIcons.getImageForFontSync(fontFamilyName, glyph, fontSize, color);
|
|
49
|
+
}
|
package/src/scripts/getFonts.ts
CHANGED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
package com.reactnativevectoricons.common;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.Promise;
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
8
|
-
|
|
9
|
-
import com.facebook.react.views.text.ReactFontManager;
|
|
10
|
-
|
|
11
|
-
import android.content.Context;
|
|
12
|
-
import android.graphics.Paint;
|
|
13
|
-
import android.graphics.Canvas;
|
|
14
|
-
import android.graphics.Typeface;
|
|
15
|
-
import android.graphics.Rect;
|
|
16
|
-
import android.graphics.Bitmap;
|
|
17
|
-
import android.graphics.Bitmap.CompressFormat;
|
|
18
|
-
|
|
19
|
-
import java.io.File;
|
|
20
|
-
import java.io.FileOutputStream;
|
|
21
|
-
import java.io.IOException;
|
|
22
|
-
import java.io.FileNotFoundException;
|
|
23
|
-
import java.util.HashMap;
|
|
24
|
-
import java.util.Map;
|
|
25
|
-
|
|
26
|
-
public class VectorIconsModule extends VectorIconsSpec {
|
|
27
|
-
public static final String NAME = "VectorIcons";
|
|
28
|
-
|
|
29
|
-
@interface Errors {
|
|
30
|
-
String E_UNKNOWN_ERROR = "E_UNKNOWN_ERROR";
|
|
31
|
-
String E_NOT_IMPLEMENTED = "E_NOT_IMPLEMENTED";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private static final Map<String, Typeface> sTypefaceCache = new HashMap<String, Typeface>();
|
|
35
|
-
|
|
36
|
-
VectorIconsModule(ReactApplicationContext context) {
|
|
37
|
-
super(context);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@Override
|
|
41
|
-
@NonNull
|
|
42
|
-
public String getName() {
|
|
43
|
-
return NAME;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@ReactMethod
|
|
47
|
-
public void loadFontWithFileName(String fontFileName, String extension, Promise promise) {
|
|
48
|
-
promise.reject(Errors.E_NOT_IMPLEMENTED);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@ReactMethod
|
|
52
|
-
public void getImageForFont(String fontFamily, String glyph, double fontSize, double color, final Promise promise) {
|
|
53
|
-
try {
|
|
54
|
-
String imagePath = getImageForFontSync(fontFamily, glyph, fontSize, color);
|
|
55
|
-
promise.resolve(imagePath);
|
|
56
|
-
} catch (Throwable fail) {
|
|
57
|
-
promise.reject(Errors.E_UNKNOWN_ERROR, fail);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
62
|
-
public String getImageForFontSync(String fontFamily, String glyph, double fontSizeD, double colorD) throws IOException, FileNotFoundException {
|
|
63
|
-
Context context = getReactApplicationContext();
|
|
64
|
-
File cacheFolder = context.getCacheDir();
|
|
65
|
-
String cacheFolderPath = cacheFolder.getAbsolutePath() + "/";
|
|
66
|
-
|
|
67
|
-
int fontSize = (int)fontSizeD;
|
|
68
|
-
int color = (int)colorD;
|
|
69
|
-
|
|
70
|
-
float scale = context.getResources().getDisplayMetrics().density;
|
|
71
|
-
String scaleSuffix = "@" + (scale == (int) scale ? Integer.toString((int) scale) : Float.toString(scale)) + "x";
|
|
72
|
-
int size = Math.round(fontSize*scale);
|
|
73
|
-
String cacheKey = fontFamily + ":" + glyph + ":" + color;
|
|
74
|
-
String hash = Integer.toString(cacheKey.hashCode(), 32);
|
|
75
|
-
String cacheFilePath = cacheFolderPath + hash + "_" + Integer.toString(fontSize) + scaleSuffix + ".png";
|
|
76
|
-
String cacheFileUrl = "file://" + cacheFilePath;
|
|
77
|
-
File cacheFile = new File(cacheFilePath);
|
|
78
|
-
|
|
79
|
-
if(cacheFile.exists()) {
|
|
80
|
-
return cacheFileUrl;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
FileOutputStream fos = null;
|
|
84
|
-
Typeface typeface = ReactFontManager.getInstance().getTypeface(fontFamily, 0, context.getAssets());
|
|
85
|
-
Paint paint = new Paint();
|
|
86
|
-
paint.setTypeface(typeface);
|
|
87
|
-
paint.setColor(color);
|
|
88
|
-
paint.setTextSize(size);
|
|
89
|
-
paint.setAntiAlias(true);
|
|
90
|
-
Rect textBounds = new Rect();
|
|
91
|
-
paint.getTextBounds(glyph, 0, glyph.length(), textBounds);
|
|
92
|
-
|
|
93
|
-
int offsetX = 0;
|
|
94
|
-
int offsetY = size - (int) paint.getFontMetrics().bottom;
|
|
95
|
-
|
|
96
|
-
Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
|
97
|
-
Canvas canvas = new Canvas(bitmap);
|
|
98
|
-
canvas.drawText(glyph, offsetX, offsetY, paint);
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
fos = new FileOutputStream(cacheFile);
|
|
102
|
-
bitmap.compress(CompressFormat.PNG, 100, fos);
|
|
103
|
-
fos.flush();
|
|
104
|
-
fos.close();
|
|
105
|
-
fos = null;
|
|
106
|
-
|
|
107
|
-
return cacheFileUrl;
|
|
108
|
-
}
|
|
109
|
-
finally {
|
|
110
|
-
if (fos != null) {
|
|
111
|
-
try {
|
|
112
|
-
fos.close();
|
|
113
|
-
fos = null;
|
|
114
|
-
}
|
|
115
|
-
catch (IOException e) {
|
|
116
|
-
e.printStackTrace();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
package com.reactnativevectoricons.common;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.Nullable;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.NativeModule;
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.module.model.ReactModuleInfo;
|
|
8
|
-
import com.facebook.react.module.model.ReactModuleInfoProvider;
|
|
9
|
-
import com.facebook.react.TurboReactPackage;
|
|
10
|
-
|
|
11
|
-
import java.util.HashMap;
|
|
12
|
-
import java.util.Map;
|
|
13
|
-
|
|
14
|
-
public class VectorIconsPackage extends TurboReactPackage {
|
|
15
|
-
|
|
16
|
-
@Nullable
|
|
17
|
-
@Override
|
|
18
|
-
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
|
|
19
|
-
if (name.equals(VectorIconsModule.NAME)) {
|
|
20
|
-
return new VectorIconsModule(reactContext);
|
|
21
|
-
} else {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@Override
|
|
27
|
-
public ReactModuleInfoProvider getReactModuleInfoProvider() {
|
|
28
|
-
return () -> {
|
|
29
|
-
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
|
|
30
|
-
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
31
|
-
moduleInfos.put(
|
|
32
|
-
VectorIconsModule.NAME,
|
|
33
|
-
new ReactModuleInfo(
|
|
34
|
-
VectorIconsModule.NAME,
|
|
35
|
-
VectorIconsModule.NAME,
|
|
36
|
-
false, // canOverrideExistingModule
|
|
37
|
-
false, // needsEagerInit
|
|
38
|
-
true, // hasConstants
|
|
39
|
-
false, // isCxxModule
|
|
40
|
-
isTurboModule // isTurboModule
|
|
41
|
-
));
|
|
42
|
-
return moduleInfos;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.reactnativevectoricons.common;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
5
|
-
import com.facebook.react.bridge.Promise;
|
|
6
|
-
|
|
7
|
-
import java.io.IOException;
|
|
8
|
-
import java.io.FileNotFoundException;
|
|
9
|
-
|
|
10
|
-
abstract class VectorIconsSpec extends ReactContextBaseJavaModule {
|
|
11
|
-
VectorIconsSpec(ReactApplicationContext context) {
|
|
12
|
-
super(context);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public abstract void getImageForFont(String fontFamily, String glyph, double fontSize, double color, final Promise promise);
|
|
16
|
-
public abstract String getImageForFontSync(String fontFamily, String glyph, double fontSize, double color) throws IOException, FileNotFoundException;
|
|
17
|
-
public abstract void loadFontWithFileName(String fontFileName, String extension, Promise promise);
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
export interface Spec extends TurboModule {
|
|
3
|
-
getImageForFont(fontName: string, glyph: string, fontSize: number, color: number): Promise<string>;
|
|
4
|
-
getImageForFontSync(fontName: string, glyph: string, fontSize: number, color: number): string;
|
|
5
|
-
loadFontWithFileName(fontFileName: string, extension: string, subdirectory?: string): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: Spec;
|
|
8
|
-
export default _default;
|
|
9
|
-
//# sourceMappingURL=NativeVectorIcons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVectorIcons.d.ts","sourceRoot":"","sources":["../../../src/NativeVectorIcons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAE9F,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrG;;AAED,wBAAqE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVectorIcons.web.d.ts","sourceRoot":"","sources":["../../../src/NativeVectorIcons.web.ts"],"names":[],"mappings":";AAAA,wBAAkB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { type Ref } from 'react';
|
|
2
|
-
import { Text, type TextProps, type TextStyle } from 'react-native';
|
|
3
|
-
export declare const DEFAULT_ICON_SIZE = 12;
|
|
4
|
-
export declare const DEFAULT_ICON_COLOR = "black";
|
|
5
|
-
export type IconProps<T> = TextProps & {
|
|
6
|
-
name: T;
|
|
7
|
-
size?: number;
|
|
8
|
-
color?: TextStyle['color'];
|
|
9
|
-
innerRef?: Ref<Text>;
|
|
10
|
-
};
|
|
11
|
-
export declare const createIconSet: <GM extends Record<string, number>>(glyphMap: GM, fontFamily: string, fontFile: string, fontStyle?: TextProps['style']) => React.ForwardRefExoticComponent<TextProps & {
|
|
12
|
-
name: keyof GM;
|
|
13
|
-
size?: number | undefined;
|
|
14
|
-
color?: TextStyle['color'];
|
|
15
|
-
innerRef?: React.Ref<Text> | undefined;
|
|
16
|
-
} & React.RefAttributes<Text>> & {
|
|
17
|
-
getImageSource: (name: keyof GM, size?: number, color?: TextStyle['color']) => Promise<{
|
|
18
|
-
uri: string;
|
|
19
|
-
scale: number;
|
|
20
|
-
} | undefined>;
|
|
21
|
-
getImageSourceSync: (name: keyof GM, size?: number, color?: TextStyle['color']) => {
|
|
22
|
-
uri: string;
|
|
23
|
-
scale: number;
|
|
24
|
-
} | undefined;
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=create-icon-set.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-icon-set.d.ts","sourceRoot":"","sources":["../../../src/create-icon-set.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAwB,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAgB,MAAM,cAAc,CAAC;AAMxG,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,SAAS,GAAG;IACrC,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,QAAQ,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,gDACd,EAAE,cACA,MAAM,YACR,MAAM,cACJ,SAAS,CAAC,OAAO,CAAC;;;YARtB,SAAS,CAAC,OAAO,CAAC;;;2BA2GlB,MAAM,EAAE,yBAEP,SAAS,CAAC,OAAO,CAAC;;;;+BAlCnB,MAAM,EAAE,yBAEP,SAAS,CAAC,OAAO,CAAC;;;;CAmE5B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-icon-source-cache.d.ts","sourceRoot":"","sources":["../../../src/create-icon-source-cache.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,UAAU,UAAU,CAAC;AAC3B,QAAA,MAAM,UAAU,UAAU,CAAC;AAE3B,KAAK,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,OAAO,UAAU,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,UAAU,CAAC;IAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAErG,MAAM,CAAC,OAAO,UAAU,qBAAqB;oBAGpB,MAAM,SAAS,SAAS;oBAExB,MAAM,SAAS,KAAK;eAEzB,MAAM;eAEN,MAAM;EAczB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-native-module-available.d.ts","sourceRoot":"","sources":["../../../src/ensure-native-module-available.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,2BAA2B,SAMlD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzF,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/scripts/common.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,YAAY,wBAAyB,MAAM,aAMvD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFonts.d.ts","sourceRoot":"","sources":["../../../../src/scripts/getFonts.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updatePlist.d.ts","sourceRoot":"","sources":["../../../../src/scripts/updatePlist.ts"],"names":[],"mappings":""}
|
|
File without changes
|