@xyo-network/location-plugin 4.1.1 → 5.0.0
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/neutral/index.d.ts +5 -29
- package/package.json +15 -12
- package/src/spec/Plugin.dom.spec.ts +22 -0
- package/typedoc.json +0 -5
- package/xy.config.ts +0 -10
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
8
|
-
declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
9
|
-
type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
10
|
-
schema: CurrentLocationWitnessConfigSchema;
|
|
11
|
-
}>;
|
|
12
|
-
interface CurrentLocationWitnessParams extends ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>> {
|
|
13
|
-
geolocation?: Geolocation;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const CurrentLocationPayloadSet: PayloadSetPayload;
|
|
17
|
-
|
|
18
|
-
declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
19
|
-
static readonly configSchemas: Schema[];
|
|
20
|
-
static readonly defaultConfigSchema: Schema;
|
|
21
|
-
get geolocation(): Geolocation;
|
|
22
|
-
getCurrentPosition(): Promise<GeolocationPosition>;
|
|
23
|
-
protected observeHandler(): Promise<Payload[]>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
declare const LocationPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<CurrentLocationWitness<CurrentLocationWitnessParams>>;
|
|
27
|
-
|
|
28
|
-
export { CurrentLocationPayloadSet, CurrentLocationWitness, CurrentLocationWitnessConfigSchema, LocationPlugin, LocationPlugin as default };
|
|
29
|
-
export type { CurrentLocationWitnessConfig, CurrentLocationWitnessParams };
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './CurrentLocationPayloadSet.ts';
|
|
3
|
+
export * from './CurrentLocationWitness.ts';
|
|
4
|
+
export { LocationPlugin as default, LocationPlugin } from './Plugin.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/location-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -28,20 +28,23 @@
|
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
31
35
|
"dependencies": {
|
|
32
|
-
"@xylabs/assert": "^
|
|
33
|
-
"@xyo-network/abstract-witness": "^
|
|
34
|
-
"@xyo-network/location-payload-plugin": "^
|
|
35
|
-
"@xyo-network/module-model": "^
|
|
36
|
-
"@xyo-network/payload-model": "^
|
|
37
|
-
"@xyo-network/payloadset-plugin": "^
|
|
38
|
-
"@xyo-network/witness-model": "^
|
|
36
|
+
"@xylabs/assert": "^5.0.0",
|
|
37
|
+
"@xyo-network/abstract-witness": "^5.0.0",
|
|
38
|
+
"@xyo-network/location-payload-plugin": "^5.0.0",
|
|
39
|
+
"@xyo-network/module-model": "^5.0.0",
|
|
40
|
+
"@xyo-network/payload-model": "^5.0.0",
|
|
41
|
+
"@xyo-network/payloadset-plugin": "^5.0.0",
|
|
42
|
+
"@xyo-network/witness-model": "^5.0.0"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.
|
|
42
|
-
"@xylabs/tsconfig-dom": "^7.0.
|
|
43
|
-
"@xylabs/vitest-extended": "^
|
|
44
|
-
"knip": "^5.62.0",
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.2",
|
|
46
|
+
"@xylabs/tsconfig-dom": "^7.0.2",
|
|
47
|
+
"@xylabs/vitest-extended": "^5.0.0",
|
|
45
48
|
"typescript": "^5.8.3",
|
|
46
49
|
"vitest": "^3.2.4"
|
|
47
50
|
},
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '@xylabs/vitest-extended'
|
|
2
|
+
|
|
3
|
+
import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
|
|
4
|
+
import {
|
|
5
|
+
describe, expect,
|
|
6
|
+
test,
|
|
7
|
+
} from 'vitest'
|
|
8
|
+
|
|
9
|
+
import { CurrentLocationWitnessConfigSchema } from '../Config.ts'
|
|
10
|
+
import { LocationPlugin } from '../Plugin.ts'
|
|
11
|
+
|
|
12
|
+
describe('LocationPlugin', () => {
|
|
13
|
+
test('Add to Resolver', async () => {
|
|
14
|
+
const plugin = LocationPlugin()
|
|
15
|
+
const resolver = await new PayloadSetPluginResolver().register(plugin, {
|
|
16
|
+
config: { schema: CurrentLocationWitnessConfigSchema },
|
|
17
|
+
geolocation: navigator.geolocation,
|
|
18
|
+
})
|
|
19
|
+
expect(await resolver.resolve(plugin.set)).toBeObject()
|
|
20
|
+
expect(await resolver.witness(plugin.set)).toBeObject()
|
|
21
|
+
})
|
|
22
|
+
})
|
package/typedoc.json
DELETED