@ankhorage/contracts 22.0.0 → 22.0.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/CHANGELOG.md +6 -0
- package/README.md +3 -1
- package/dist/appManifest/splashScreen.d.ts +8 -11
- package/dist/appManifest/splashScreen.d.ts.map +1 -1
- package/dist/appManifest/splashScreen.js.map +1 -1
- package/package.json +2 -3
- package/src/appManifest/splashScreen.test.ts +3 -3
- package/src/appManifest/splashScreen.ts +8 -18
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/contracts
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
9
9
|
|
|
@@ -22,4 +22,6 @@ Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
|
22
22
|
- [isInfraManifest sequence](././paradox/diagrams/sequences/is-infra-manifest.mmd)
|
|
23
23
|
- [isInfraWorkloadSpec sequence](././paradox/diagrams/sequences/is-infra-workload-spec.mmd)
|
|
24
24
|
- [isMediaAssetReference sequence](././paradox/diagrams/sequences/is-media-asset-reference.mmd)
|
|
25
|
+
- [isSerializableSet sequence](././paradox/diagrams/sequences/is-serializable-set.mmd)
|
|
26
|
+
- [isSerializableValue sequence](././paradox/diagrams/sequences/is-serializable-value.mmd)
|
|
25
27
|
- [parseInfraManifest sequence](././paradox/diagrams/sequences/parse-infra-manifest.mmd)
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import type { Props as ExpoSplashScreenPluginProps } from 'expo-splash-screen/plugin';
|
|
2
1
|
import type { MediaAssetReference } from '../media';
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
readonly
|
|
6
|
-
}> = Readonly<Omit<T, 'image'>> & {
|
|
2
|
+
export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
|
|
3
|
+
export interface SplashScreenModeSpec {
|
|
4
|
+
readonly backgroundColor?: string;
|
|
7
5
|
readonly image?: MediaAssetReference;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
}
|
|
7
|
+
export interface SplashScreenSpec extends SplashScreenModeSpec {
|
|
8
|
+
readonly imageWidth?: number;
|
|
9
|
+
readonly resizeMode?: SplashScreenResizeMode;
|
|
12
10
|
readonly dark?: SplashScreenModeSpec;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
11
|
+
}
|
|
15
12
|
//# sourceMappingURL=splashScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splashScreen.d.ts","sourceRoot":"","sources":["../../src/appManifest/splashScreen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"splashScreen.d.ts","sourceRoot":"","sources":["../../src/appManifest/splashScreen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splashScreen.js","sourceRoot":"","sources":["../../src/appManifest/splashScreen.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"splashScreen.js","sourceRoot":"","sources":["../../src/appManifest/splashScreen.ts"],"names":[],"mappings":"","sourcesContent":["import type { MediaAssetReference } from '../media';\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenModeSpec {\n readonly backgroundColor?: string;\n readonly image?: MediaAssetReference;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n readonly dark?: SplashScreenModeSpec;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"ankh": {
|
|
6
6
|
"category": "contracts",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@ankhorage/color-theory": "^0.3.0",
|
|
14
|
-
"@ankhorage/utility": "^0.8.0"
|
|
15
|
-
"expo-splash-screen": "~57.0.9"
|
|
14
|
+
"@ankhorage/utility": "^0.8.0"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
17
|
"@ankhorage/devtools": "^1.12.0",
|
|
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'bun:test';
|
|
|
3
3
|
import type { AppManifest, SplashScreenSpec } from '../index';
|
|
4
4
|
|
|
5
5
|
describe('AppManifest splash screen contract', () => {
|
|
6
|
-
it('accepts portable media references with
|
|
6
|
+
it('accepts portable media references with the canonical splash option shape', () => {
|
|
7
7
|
const splashScreen: SplashScreenSpec = {
|
|
8
8
|
backgroundColor: '#ffffff',
|
|
9
9
|
image: { mediaId: 'splash-logo' },
|
|
@@ -23,13 +23,13 @@ describe('AppManifest splash screen contract', () => {
|
|
|
23
23
|
it('keeps root-only Expo options out of dark-mode overrides', () => {
|
|
24
24
|
const splashWithDarkImageWidth: SplashScreenSpec = {
|
|
25
25
|
dark: {
|
|
26
|
-
// @ts-expect-error
|
|
26
|
+
// @ts-expect-error Dark-mode overrides do not include image sizing.
|
|
27
27
|
imageWidth: 160,
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
const splashWithDarkResizeMode: SplashScreenSpec = {
|
|
31
31
|
dark: {
|
|
32
|
-
// @ts-expect-error
|
|
32
|
+
// @ts-expect-error Dark-mode overrides do not include resize mode.
|
|
33
33
|
resizeMode: 'contain',
|
|
34
34
|
},
|
|
35
35
|
};
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import type { Props as ExpoSplashScreenPluginProps } from 'expo-splash-screen/plugin';
|
|
2
|
-
|
|
3
1
|
import type { MediaAssetReference } from '../media';
|
|
4
2
|
|
|
5
|
-
type
|
|
6
|
-
ExpoSplashScreenPluginProps,
|
|
7
|
-
'backgroundColor' | 'image' | 'imageWidth' | 'resizeMode'
|
|
8
|
-
>;
|
|
3
|
+
export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
> & {
|
|
5
|
+
export interface SplashScreenModeSpec {
|
|
6
|
+
readonly backgroundColor?: string;
|
|
13
7
|
readonly image?: MediaAssetReference;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type SplashScreenResizeMode = NonNullable<ExpoSplashScreenPluginProps['resizeMode']>;
|
|
17
|
-
|
|
18
|
-
export type SplashScreenModeSpec = PortableSplashScreenProps<
|
|
19
|
-
NonNullable<ExpoSplashScreenPluginProps['dark']>
|
|
20
|
-
>;
|
|
8
|
+
}
|
|
21
9
|
|
|
22
|
-
export
|
|
10
|
+
export interface SplashScreenSpec extends SplashScreenModeSpec {
|
|
11
|
+
readonly imageWidth?: number;
|
|
12
|
+
readonly resizeMode?: SplashScreenResizeMode;
|
|
23
13
|
readonly dark?: SplashScreenModeSpec;
|
|
24
|
-
}
|
|
14
|
+
}
|