@herdingbits/trailhead-types 0.0.4 → 0.0.6

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.
Files changed (2) hide show
  1. package/README.md +14 -5
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @herdingbits/trailhead-types
2
2
 
3
- TypeScript type definitions for Trailhead single page applications (SPAs).
3
+ TypeScript types for Trailhead SPAs. Provides shell API types for independent applications.
4
4
 
5
5
  **Note:** This package is auto-generated from `@herdingbits/trailhead-core` during build. Do not edit these files directly.
6
6
 
@@ -8,6 +8,8 @@ TypeScript type definitions for Trailhead single page applications (SPAs).
8
8
 
9
9
  Provides TypeScript types for single page applications (SPAs) that integrate with the Trailhead shell. Install this as a dev dependency to get type checking and IntelliSense for the shell API.
10
10
 
11
+ **Your SPAs don't import the shell** - they access it via `window.shell`. These types just help TypeScript understand what's available.
12
+
11
13
  ## Installation
12
14
 
13
15
  ```bash
@@ -21,11 +23,18 @@ npm install --save-dev @herdingbits/trailhead-types
21
23
  ```typescript
22
24
  import type { ShellAPI } from '@herdingbits/trailhead-types';
23
25
 
24
- export function init(shell: ShellAPI) {
26
+ // Declare global type
27
+ declare global {
28
+ interface Window {
29
+ shell: ShellAPI;
30
+ }
31
+ }
32
+
33
+ export function init() {
25
34
  // TypeScript knows the shell API
26
- shell.feedback.success('App loaded!');
35
+ window.shell.feedback.success('App loaded!');
27
36
 
28
- const result = await shell.http.get('/api/data');
37
+ const result = await window.shell.http.get('/api/data');
29
38
  if (result.success) {
30
39
  console.log(result.data);
31
40
  }
@@ -53,7 +62,7 @@ export class MyAdapter implements DesignSystemAdapter {
53
62
 
54
63
  ## Documentation
55
64
 
56
- See the [main Trailhead documentation](https://github.com/herdingbits/trailhead) for more information.
65
+ See the [main Trailhead documentation](https://github.com/quicken/trailhead) for more information.
57
66
 
58
67
  ## License
59
68
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@herdingbits/trailhead-types",
3
- "version": "0.0.4",
4
- "description": "TypeScript type definitions for Trailhead micro-frontend framework",
3
+ "version": "0.0.6",
4
+ "description": "TypeScript types for Trailhead SPAs. Provides shell API types for independent applications.",
5
5
  "type": "module",
6
6
  "types": "./public-api.d.ts",
7
7
  "exports": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "https://github.com/herdingbits/trailhead.git",
33
+ "url": "https://github.com/quicken/trailhead.git",
34
34
  "directory": "packages/types"
35
35
  }
36
- }
36
+ }