@atlaskit/ads-mcp 1.0.0 → 1.2.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/index.js +27 -1
  3. package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
  4. package/dist/cjs/tools/get-all-components/types.js +5 -1
  5. package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +35 -6
  6. package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +206 -0
  7. package/dist/cjs/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.js +40 -0
  8. package/dist/cjs/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.js +22 -0
  9. package/dist/cjs/tools/get-atlaskit-hooks/types.js +5 -0
  10. package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +836 -0
  11. package/dist/cjs/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.js +40 -0
  12. package/dist/cjs/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.js +22 -0
  13. package/dist/cjs/tools/get-atlaskit-utilities/types.js +5 -0
  14. package/dist/cjs/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -4
  15. package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +31 -11
  16. package/dist/cjs/tools/i18n-conversion/guide.js +7 -7
  17. package/dist/cjs/tools/i18n-conversion/list-i18n-conversion-tool.js +1 -1
  18. package/dist/cjs/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.js +22 -0
  19. package/dist/cjs/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +11 -0
  20. package/dist/cjs/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.js +109 -0
  21. package/dist/cjs/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.js +22 -0
  22. package/dist/cjs/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +11 -0
  23. package/dist/cjs/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.js +111 -0
  24. package/dist/cjs/tools/types.js +1 -0
  25. package/dist/es2019/index.js +30 -0
  26. package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
  27. package/dist/es2019/tools/get-all-components/types.js +1 -0
  28. package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +35 -6
  29. package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +200 -0
  30. package/dist/es2019/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.js +14 -0
  31. package/dist/es2019/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.js +21 -0
  32. package/dist/es2019/tools/get-atlaskit-hooks/types.js +1 -0
  33. package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +830 -0
  34. package/dist/es2019/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.js +14 -0
  35. package/dist/es2019/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.js +21 -0
  36. package/dist/es2019/tools/get-atlaskit-utilities/types.js +1 -0
  37. package/dist/es2019/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -4
  38. package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +31 -11
  39. package/dist/es2019/tools/i18n-conversion/guide.js +7 -7
  40. package/dist/es2019/tools/i18n-conversion/list-i18n-conversion-tool.js +1 -1
  41. package/dist/es2019/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.js +19 -0
  42. package/dist/es2019/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +5 -0
  43. package/dist/es2019/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.js +79 -0
  44. package/dist/es2019/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.js +19 -0
  45. package/dist/es2019/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +5 -0
  46. package/dist/es2019/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.js +81 -0
  47. package/dist/es2019/tools/types.js +0 -0
  48. package/dist/esm/index.js +27 -1
  49. package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
  50. package/dist/esm/tools/get-all-components/types.js +1 -0
  51. package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +35 -6
  52. package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +200 -0
  53. package/dist/esm/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.js +32 -0
  54. package/dist/esm/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.js +16 -0
  55. package/dist/esm/tools/get-atlaskit-hooks/types.js +1 -0
  56. package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +830 -0
  57. package/dist/esm/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.js +32 -0
  58. package/dist/esm/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.js +16 -0
  59. package/dist/esm/tools/get-atlaskit-utilities/types.js +1 -0
  60. package/dist/esm/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -4
  61. package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +31 -11
  62. package/dist/esm/tools/i18n-conversion/guide.js +7 -7
  63. package/dist/esm/tools/i18n-conversion/list-i18n-conversion-tool.js +1 -1
  64. package/dist/esm/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.js +16 -0
  65. package/dist/esm/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +5 -0
  66. package/dist/esm/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.js +102 -0
  67. package/dist/esm/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.js +16 -0
  68. package/dist/esm/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +5 -0
  69. package/dist/esm/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.js +106 -0
  70. package/dist/esm/tools/types.js +0 -0
  71. package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
  72. package/dist/types/tools/get-all-components/types.d.ts +2 -1
  73. package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
  74. package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +10 -0
  75. package/dist/types/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.d.ts +6 -0
  76. package/dist/types/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.d.ts +2 -0
  77. package/dist/types/tools/get-atlaskit-hooks/types.d.ts +14 -0
  78. package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +10 -0
  79. package/dist/types/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.d.ts +6 -0
  80. package/dist/types/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.d.ts +2 -0
  81. package/dist/types/tools/get-atlaskit-utilities/types.d.ts +41 -0
  82. package/dist/types/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +1 -1
  83. package/dist/types/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
  84. package/dist/types/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.d.ts +2 -0
  85. package/dist/types/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.d.ts +11 -0
  86. package/dist/types/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.d.ts +4 -0
  87. package/dist/types/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.d.ts +2 -0
  88. package/dist/types/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.d.ts +11 -0
  89. package/dist/types/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.d.ts +4 -0
  90. package/dist/types/tools/types.d.ts +12 -0
  91. package/package.json +3 -3
@@ -0,0 +1,830 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Structured content utilities from design-system *.docs.tsx files
5
+ *
6
+ * @codegen <<SignedSource::5377d3666260be828ea690f4b3ef04b7>>
7
+ * @codegenCommand yarn workspace @af/ads-ai-tooling codegen:atlaskit-utilities
8
+ */
9
+ /* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
10
+
11
+ export var atlaskitUtilities = [{
12
+ name: 'a11yAuditExamples',
13
+ description: 'Runs an a11y audit against every constellation example for the given package(s). Use in a top-level test file to ensure every documented variant passes the design-system audit rules.',
14
+ status: 'general-availability',
15
+ usageGuidelines: ['One call per package or component group. Pair with `a11yAuditExamplesCLI()` if you want to run the same audit set from a CLI script outside jest.'],
16
+ keywords: ['accessibility', 'a11y', 'examples', 'constellation', 'audit', 'testing'],
17
+ category: 'testing',
18
+ package: '@af/accessibility-testing',
19
+ examples: [],
20
+ kind: 'function'
21
+ }, {
22
+ name: 'a11yAuditExamplesCLI',
23
+ description: 'CLI entry point for running the same constellation example audit as `a11yAuditExamples()` outside of jest.',
24
+ status: 'general-availability',
25
+ usageGuidelines: ['Use from a script when you want to validate examples without booting jest. Inside jest, prefer `a11yAuditExamples()`.'],
26
+ keywords: ['accessibility', 'a11y', 'examples', 'cli', 'audit', 'testing'],
27
+ category: 'testing',
28
+ package: '@af/accessibility-testing',
29
+ examples: [],
30
+ kind: 'function'
31
+ }, {
32
+ name: 'announce',
33
+ description: 'Pushes a message to the shared visually-hidden live region (creating it lazily on first call). The update is debounced by ~1s so that focus-change events around the drag do not interrupt the announcement.',
34
+ status: 'general-availability',
35
+ usageGuidelines: ['Call `announce` from drag lifecycle callbacks (`onDragStart`, `onDrop`, custom keyboard shortcuts) when the next state change has no other accessible signal.', 'Keep messages short and use the imperative ("Picked up card 3", "Moved to top of list") — long sentences are likely to be interrupted by the next focus change.', 'Localise messages at the call site; this package does no translation.'],
36
+ accessibilityGuidelines: ['Pairs with the rest of `@atlaskit/pragmatic-drag-and-drop-react-accessibility`. Use this when neither focus movement nor visible text already communicates the change to assistive tech.'],
37
+ keywords: ['pragmatic-drag-and-drop', 'pdnd', 'live-region', 'a11y', 'announce', 'screen-reader'],
38
+ category: 'drag-and-drop',
39
+ package: '@atlaskit/pragmatic-drag-and-drop-live-region',
40
+ examples: [],
41
+ kind: 'function',
42
+ parameters: [{
43
+ name: 'message',
44
+ type: 'string',
45
+ description: 'Plain text to be read by screen readers.'
46
+ }],
47
+ returns: {
48
+ type: 'void'
49
+ },
50
+ signature: '(message: string) => void'
51
+ }, {
52
+ name: 'attachClosestEdge',
53
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. Computes which of the `allowedEdges` of an element is closest to the pointer and stores the result against a private symbol in `userData`. Pair with `extractClosestEdge` in `onDrop` for type-safe lookup.',
54
+ status: 'general-availability',
55
+ usageGuidelines: ['Call from inside a drop target `getData` so the closest edge tracks the pointer as it moves.', 'Always pair with `extractClosestEdge` — the value is stored against a non-public `Symbol` and is not directly accessible.'],
56
+ keywords: ['pdnd', 'hitbox', 'attachClosestEdge', 'edge'],
57
+ category: 'drag-and-drop',
58
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
59
+ examples: [],
60
+ kind: 'function',
61
+ parameters: [{
62
+ name: 'userData',
63
+ type: 'Record<string | symbol, unknown>',
64
+ description: 'The data object you are returning from the drop target `getData`. Returned as a new object — non-mutating.'
65
+ }, {
66
+ name: 'opts',
67
+ type: '{ element: Element; input: Input; allowedEdges: Edge[] }',
68
+ description: '`element` is the drop target DOM node, `input` is the pointer input from the drop event, `allowedEdges` is the subset of `top` | `right` | `bottom` | `left` that should be considered.'
69
+ }],
70
+ returns: {
71
+ type: 'Record<string | symbol, unknown>',
72
+ description: 'A shallow copy of `userData` with the closest edge attached.'
73
+ },
74
+ signature: '(userData: Record<string | symbol, unknown>, opts: { element: Element; input: Input; allowedEdges: Edge[] }) => Record<string | symbol, unknown>'
75
+ }, {
76
+ name: 'attachInstruction',
77
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Computes a list-item drop instruction (reorder-before, reorder-after, or combine) based on the operations declared as available, then stores it against `userData`. Disabled operations are silently ignored so the hitbox auto-adjusts.',
78
+ status: 'general-availability',
79
+ usageGuidelines: ['Use when implementing list reorder UI — pair with `extractInstruction` in `onDrop` to perform the actual move.', 'When all operations are `"not-available"` the helper returns `userData` unchanged; `extractInstruction` will then return `null`.'],
80
+ keywords: ['pdnd', 'hitbox', 'attachInstruction', 'reorder', 'list-item'],
81
+ category: 'drag-and-drop',
82
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
83
+ examples: [],
84
+ kind: 'function',
85
+ parameters: [{
86
+ name: 'userData',
87
+ type: 'Record<string | symbol, unknown>'
88
+ }, {
89
+ name: 'opts',
90
+ type: "{ operations: { 'reorder-before'?: Availability; 'reorder-after'?: Availability; combine?: Availability }; element: Element; input: Input; axis?: Axis }",
91
+ description: 'Each operation defaults to `"not-available"`. `axis` defaults to `"vertical"` for traditional top-to-bottom lists.'
92
+ }],
93
+ returns: {
94
+ type: 'Record<string | symbol, unknown>'
95
+ },
96
+ signature: "(userData: Record<string | symbol, unknown>, opts: { operations: { [op: string]: 'available' | 'blocked' | 'not-available' }; element: Element; input: Input; axis?: 'horizontal' | 'vertical' }) => Record<string | symbol, unknown>"
97
+ }, {
98
+ name: 'autoA11yCheck',
99
+ description: 'Runs the `@sa11y/jest` audit against the current document after each `it()` block. Wired into the design-system jest setup, so every component test gets a free a11y pass without per-test boilerplate.',
100
+ status: 'general-availability',
101
+ usageGuidelines: ["Already registered globally for `packages/design-system/*` tests — you typically should not call this directly. If a package is intentionally excluded (see `ignorePackages` in `scan-document.tsx`), opt back in by importing this and registering it in that package's jest setup.", 'If a single test must skip the audit (long-running snapshot tests, intentional violations under review), use `skipA11yAudit()` inside that test rather than disabling the whole hook.'],
102
+ keywords: ['accessibility', 'a11y', 'autoA11yCheck', 'sa11y', 'jest', 'testing'],
103
+ category: 'testing',
104
+ package: '@af/accessibility-testing',
105
+ examples: [],
106
+ kind: 'function',
107
+ signature: '() => void'
108
+ }, {
109
+ name: 'axe',
110
+ description: 'Pre-configured wrapper around `jest-axe` that runs against either a provided element/HTML string or `document.body.innerHTML` by default. Asserts no violations via `expect(...).toHaveNoViolations()` and returns the full axe results.',
111
+ status: 'general-availability',
112
+ usageGuidelines: ['Reach for `axe()` inside a specific test (e.g. after rendering a component variant) when you need a one-off accessibility assertion. For repo-wide enforcement, prefer `autoA11yCheck()`, which runs as part of the existing test lifecycle.', "Pass the rendered component's container rather than the whole document when possible — it keeps the audit scope tight and the error output readable."],
113
+ keywords: ['accessibility', 'a11y', 'axe', 'jest-axe', 'testing'],
114
+ category: 'testing',
115
+ package: '@af/accessibility-testing',
116
+ examples: [],
117
+ kind: 'function',
118
+ parameters: [{
119
+ name: 'html',
120
+ type: 'Element | string',
121
+ description: 'DOM element or HTML string to audit. Omit to scan `document.body.innerHTML` (the `region` rule is disabled in that case because most jest fixtures lack landmark roles).',
122
+ isOptional: true
123
+ }, {
124
+ name: 'options',
125
+ type: 'JestAxeConfigureOptions',
126
+ description: 'Axe configuration overrides merged on top of the design-system defaults.',
127
+ isOptional: true
128
+ }],
129
+ returns: {
130
+ type: 'Promise<AxeResults>',
131
+ description: 'Resolves with the full axe results once the no-violations assertion passes.'
132
+ },
133
+ signature: '(html?: Element | string, options?: JestAxeConfigureOptions) => Promise<AxeResults>'
134
+ }, {
135
+ name: 'BaseUrls',
136
+ description: 'Record of resolver environments to Stargate base URLs. Three production aliases (`prd`, `prod`, `production`) all map to the same host; the same goes for `dev` / `development` and `stg` / `staging`. Underlying source of truth for `getBaseUrl`; exported for tests and downstream packages that need to match on the host.',
137
+ status: 'general-availability',
138
+ usageGuidelines: ['Prefer calling `getBaseUrl(envKey)` at runtime instead of indexing this constant directly — the runtime path picks up env-detection overrides for tests and SSR.'],
139
+ keywords: ['constant', 'BaseUrls', 'environment', 'linking-common'],
140
+ category: 'linking',
141
+ package: '@atlaskit/linking-common',
142
+ examples: [],
143
+ kind: 'constant',
144
+ type: "Record<'dev' | 'development' | 'stg' | 'staging' | 'prd' | 'prod' | 'production', string>"
145
+ }, {
146
+ name: 'cardAction',
147
+ description: 'Action creator for the Smart Card Redux store. Builds a `CardAction<T>` from an action type and a `{ url }` params object, plus optional payload, error, metadata status, and an `ignoreStatusCheck` flag that forces the reducer to apply the action regardless of the current/next status. Use the exported `ACTION_*` constants for the `type` argument.',
148
+ status: 'general-availability',
149
+ usageGuidelines: ['Always use the `ACTION_*` constants exported alongside `cardAction` instead of typing the string literal — adding a new action type then forces a TypeScript update at every dispatch site.', '`ignoreStatusCheck: true` bypasses the reducer guard — use only when you genuinely need to override the FSM, e.g. forcing a reload from outside the store.'],
150
+ keywords: ['utility', 'cardAction', 'redux', 'smart-card', 'linking-common'],
151
+ category: 'linking',
152
+ package: '@atlaskit/linking-common',
153
+ examples: [],
154
+ kind: 'function',
155
+ parameters: [{
156
+ name: 'type',
157
+ type: 'CardActionType'
158
+ }, {
159
+ name: 'params',
160
+ type: '{ url: string }',
161
+ description: 'Card key (URL).'
162
+ }, {
163
+ name: 'payload',
164
+ type: 'T',
165
+ isOptional: true
166
+ }, {
167
+ name: 'error',
168
+ type: 'APIError',
169
+ isOptional: true
170
+ }, {
171
+ name: 'metadataStatus',
172
+ type: 'MetadataStatus',
173
+ description: 'Hover-preview metadata fetch status.',
174
+ isOptional: true
175
+ }, {
176
+ name: 'ignoreStatusCheck',
177
+ type: 'boolean',
178
+ description: 'Forces the reducer to apply the action regardless of the current/next status transition.',
179
+ isOptional: true
180
+ }],
181
+ returns: {
182
+ type: 'CardAction<T>'
183
+ },
184
+ signature: '<T = JsonLd.Response>(type: CardActionType, params: { url: string }, payload?: T, error?: APIError, metadataStatus?: MetadataStatus, ignoreStatusCheck?: boolean) => CardAction<T>'
185
+ }, {
186
+ name: 'CardAction',
187
+ description: 'Redux action shape for the Smart Card store. Extends `AnyAction` with `type: CardActionType`, the card key `url`, an optional response `payload`, and an optional `metadataStatus`. Use the `cardAction` action creator to construct values rather than building this type by hand.',
188
+ status: 'general-availability',
189
+ keywords: ['type', 'CardAction', 'redux', 'smart-card', 'linking-common'],
190
+ category: 'linking',
191
+ package: '@atlaskit/linking-common',
192
+ examples: [],
193
+ kind: 'type',
194
+ definition: 'interface CardAction<T = JsonLd.Response> extends AnyAction { type: CardActionType; url: string; payload?: T; metadataStatus?: MetadataStatus }'
195
+ }, {
196
+ name: 'CardActions',
197
+ description: 'Family of action-type string constants exported alongside `cardAction`. Use these instead of string literals when dispatching to or reducing from the Smart Card store. Note that the constant **names** and **string values** diverge in a few places (e.g. `ACTION_ERROR === "errored"`, `ACTION_ERROR_FALLBACK === "fallback"`, `ACTION_UPDATE_METADATA_STATUS === "metadata"`) — always import the constants rather than typing the string.',
198
+ status: 'general-availability',
199
+ usageGuidelines: ["Always import the constants rather than typing the string — the constant names and the underlying values do not always match (e.g. `ACTION_ERROR === 'errored'`).", '`ACTION_RELOADING` is distinct from `ACTION_RESOLVING`: reloading happens when an already-resolved card refreshes; resolving is the first-time fetch.', '`ACTION_PRELOAD` is not in `CardActionType` — it is a Smart Card store-internal action that exists alongside the typed action set.'],
200
+ keywords: ['constant', 'CardActions', 'redux', 'smart-card', 'linking-common'],
201
+ category: 'linking',
202
+ package: '@atlaskit/linking-common',
203
+ examples: [],
204
+ kind: 'constant',
205
+ type: 'CardActionType (extended)',
206
+ value: "ACTION_PENDING === 'pending'\nACTION_RESOLVING === 'resolving'\nACTION_RESOLVED === 'resolved'\nACTION_RELOADING === 'reloading'\nACTION_ERROR === 'errored'\nACTION_ERROR_FALLBACK === 'fallback'\nACTION_PRELOAD === 'preload'\nACTION_UPDATE_METADATA_STATUS === 'metadata'"
207
+ }, {
208
+ name: 'CardAppearance',
209
+ description: 'Discriminator for how a Smart Link should render: `inline` (chip inside text), `block` (single-line block card), or `embed` (rich preview embed). Used by ADF and by consumer props.',
210
+ status: 'general-availability',
211
+ keywords: ['type', 'CardAppearance', 'smart-card', 'linking-common'],
212
+ category: 'linking',
213
+ package: '@atlaskit/linking-common',
214
+ examples: [],
215
+ kind: 'type',
216
+ definition: "type CardAppearance = 'inline' | 'block' | 'embed'"
217
+ }, {
218
+ name: 'CardType',
219
+ description: 'Lifecycle status of a Smart Card store entry. Returned by `getStatus` and stored on `CardState.status`. Drives the choice between skeleton, content, error, fallback, unauthorised, forbidden, and not-found renderings.',
220
+ status: 'general-availability',
221
+ keywords: ['type', 'CardType', 'smart-card', 'linking-common'],
222
+ category: 'linking',
223
+ package: '@atlaskit/linking-common',
224
+ examples: [],
225
+ kind: 'type',
226
+ definition: "type CardType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found'"
227
+ }, {
228
+ name: 'cleanup',
229
+ description: 'Removes the singleton live-region node from the DOM. No-op if `announce` has never been called. Mostly useful in tests to reset state between cases.',
230
+ status: 'general-availability',
231
+ usageGuidelines: ['Call from a test teardown to keep the DOM tidy between runs. Production apps rarely need this — the node is harmless to leave in place.'],
232
+ keywords: ['pragmatic-drag-and-drop', 'pdnd', 'live-region', 'cleanup', 'teardown'],
233
+ category: 'drag-and-drop',
234
+ package: '@atlaskit/pragmatic-drag-and-drop-live-region',
235
+ examples: [],
236
+ kind: 'function',
237
+ parameters: [],
238
+ returns: {
239
+ type: 'void'
240
+ },
241
+ signature: '() => void'
242
+ }, {
243
+ name: 'convertToError',
244
+ description: 'Normalises any value thrown by a `try`/`catch` into an `Error` instance — useful at the boundary between untyped JS code (which can throw strings, objects, or `undefined`) and TypeScript code that wants a real `Error`.',
245
+ status: 'general-availability',
246
+ usageGuidelines: ['Use at every catch boundary that hands the error to logging, Sentry, or analytics — those consumers all assume a real `Error` with `.message` and a stack.', 'Object errors are JSON-serialised; circular objects fall back to `String(...)`, so the stack you log will reflect where `convertToError` was called, not where the original value was thrown.'],
247
+ keywords: ['utility', 'convertToError', 'error', 'frontend-utilities'],
248
+ category: 'utilities',
249
+ package: '@atlaskit/frontend-utilities',
250
+ examples: [],
251
+ kind: 'function',
252
+ parameters: [{
253
+ name: 'e',
254
+ type: 'unknown',
255
+ description: 'The caught value. Already-`Error` instances are returned unchanged.'
256
+ }],
257
+ returns: {
258
+ type: 'Error',
259
+ description: 'The original value if it was already an `Error`; otherwise a freshly-constructed `Error` whose message describes the original (`JSON.stringify`d for objects, `String(...)`d otherwise).'
260
+ },
261
+ signature: '(e: unknown) => Error'
262
+ }, {
263
+ name: 'createAndFireEvent',
264
+ description: 'Curried helper that builds a `UIAnalyticsEvent` for a payload and fires it on a channel in one go. The original event is also returned so the call site can keep working with it.',
265
+ status: 'general-availability',
266
+ usageGuidelines: ['Reach for `createAndFireEvent` when you want a one-liner inside an event handler. For more complex flows, build and fire the event explicitly.'],
267
+ keywords: ['analytics', 'utility', 'createAndFireEvent', 'analytics-next'],
268
+ category: 'analytics',
269
+ package: '@atlaskit/analytics-next',
270
+ examples: [],
271
+ kind: 'function',
272
+ parameters: [{
273
+ name: 'channel',
274
+ type: 'string',
275
+ description: 'Optional channel to fire on.',
276
+ isOptional: true
277
+ }, {
278
+ name: 'payload',
279
+ type: 'AnalyticsEventPayload'
280
+ }, {
281
+ name: 'createAnalyticsEvent',
282
+ type: 'CreateUIAnalyticsEvent',
283
+ description: 'The factory from `useAnalyticsEvents()` or `withAnalyticsEvents`.'
284
+ }],
285
+ returns: {
286
+ type: 'UIAnalyticsEvent',
287
+ description: 'The original (un-cloned) consumer event so callers can attach further context.'
288
+ },
289
+ signature: '(channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent'
290
+ }, {
291
+ name: 'CustomAttributes',
292
+ description: 'Free-form attribute bag attached to an exposure event. Keys are validated against the reserved-attribute list at runtime — colliding with a reserved key throws.',
293
+ status: 'general-availability',
294
+ usageGuidelines: ['Keep custom attribute names stable — downstream analytics queries pivot on them. Coordinate any rename with the data-platform team before shipping.'],
295
+ keywords: ['feature-flag', 'type', 'CustomAttributes', 'exposure'],
296
+ category: 'experimentation',
297
+ package: '@atlaskit/feature-flag-client',
298
+ examples: [],
299
+ kind: 'type',
300
+ definition: 'type CustomAttributes = { [attributeName: string]: string | number | boolean | object }'
301
+ }, {
302
+ name: 'Datasource',
303
+ description: 'Public contract for a Datasource node — id, parameters bag (generic, defaults to `Record<string, unknown>`), and the view configs that describe how the resolved rows should render. Exchanged between the editor, Confluence/Jira renderers, and the resolver.',
304
+ status: 'general-availability',
305
+ keywords: ['type', 'Datasource', 'datasource', 'linking-common'],
306
+ category: 'linking',
307
+ package: '@atlaskit/linking-common',
308
+ examples: [],
309
+ kind: 'type',
310
+ definition: 'interface Datasource<P extends Record<string, unknown> = Record<string, unknown>> { id: string; parameters: P; views: DatasourceAdfView[] }'
311
+ }, {
312
+ name: 'DATASOURCE_DEFAULT_LAYOUT',
313
+ description: 'Default ADF layout applied to a Datasource node when no explicit layout is provided. Pinned constant so Confluence, Jira, and the editor render identical defaults.',
314
+ status: 'general-availability',
315
+ keywords: ['constant', 'DATASOURCE_DEFAULT_LAYOUT', 'datasource', 'linking-common'],
316
+ category: 'linking',
317
+ package: '@atlaskit/linking-common',
318
+ examples: [],
319
+ kind: 'constant',
320
+ type: "'wide'",
321
+ value: "'wide'"
322
+ }, {
323
+ name: 'Edge',
324
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. String literal union of the four cardinal edges of a drop target.',
325
+ status: 'general-availability',
326
+ keywords: ['pdnd', 'hitbox', 'Edge', 'type'],
327
+ category: 'drag-and-drop',
328
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
329
+ examples: [],
330
+ kind: 'type',
331
+ definition: "type Edge = 'top' | 'right' | 'bottom' | 'left'"
332
+ }, {
333
+ name: 'EnvironmentsKeys',
334
+ description: 'String union of the resolver environments understood by `getBaseUrl` / `getResolverUrl`. Three environments with two-or-three aliases each (`dev` / `development`, `stg` / `staging`, `prd` / `prod` / `production`), plus a special `custom` value that pairs with the `baseUrlOverride` arg for SSR / non-standard hosts.',
335
+ status: 'general-availability',
336
+ keywords: ['type', 'EnvironmentsKeys', 'environment', 'linking-common'],
337
+ category: 'linking',
338
+ package: '@atlaskit/linking-common',
339
+ examples: [],
340
+ kind: 'type',
341
+ definition: "type EnvironmentsKeys = 'dev' | 'development' | 'stg' | 'staging' | 'prd' | 'prod' | 'production' | 'custom'"
342
+ }, {
343
+ name: 'ExposureTriggerReason',
344
+ description: 'Enum describing why an exposure event was fired (auto vs. manual vs. consumer opt-in). Surfaced on the exposure event payload so downstream analytics can de-duplicate auto vs. manual fires.',
345
+ status: 'general-availability',
346
+ usageGuidelines: ['Use the enum members rather than literal strings when calling `trackFeatureFlag({ triggerReason })` — the literal values change if the backend renames a reason.'],
347
+ keywords: ['feature-flag', 'exposure', 'enum', 'ExposureTriggerReason'],
348
+ category: 'experimentation',
349
+ package: '@atlaskit/feature-flag-client',
350
+ examples: [],
351
+ kind: 'constant',
352
+ type: 'enum ExposureTriggerReason',
353
+ value: '{ OptIn = "optInExposure", Manual = "manualExposure", Default = "defaultExposure", AutoExposure = "autoExposure", hasCustomAttributes = "hasCustomAttributes" }'
354
+ }, {
355
+ name: 'extractClosestEdge',
356
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. Reads the edge previously written by `attachClosestEdge`. Returns `null` if no edge was attached.',
357
+ status: 'general-availability',
358
+ usageGuidelines: ['Use in `onDrag` or `onDrop` to decide whether to render the drop indicator above/below/left/right of the target.'],
359
+ keywords: ['pdnd', 'hitbox', 'extractClosestEdge', 'edge'],
360
+ category: 'drag-and-drop',
361
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
362
+ examples: [],
363
+ kind: 'function',
364
+ parameters: [{
365
+ name: 'userData',
366
+ type: 'Record<string | symbol, unknown>',
367
+ description: 'The `userData` produced by `attachClosestEdge`, typically read from the dropped target.'
368
+ }],
369
+ returns: {
370
+ type: 'Edge | null'
371
+ },
372
+ signature: '(userData: Record<string | symbol, unknown>) => Edge | null'
373
+ }, {
374
+ name: 'extractInstruction',
375
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Reads the instruction previously written by `attachInstruction`. Returns `null` when no instruction is available (e.g. all operations were blocked).',
376
+ status: 'general-availability',
377
+ keywords: ['pdnd', 'hitbox', 'extractInstruction', 'reorder', 'list-item'],
378
+ category: 'drag-and-drop',
379
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
380
+ examples: [],
381
+ kind: 'function',
382
+ parameters: [{
383
+ name: 'userData',
384
+ type: 'Record<string | symbol, unknown>'
385
+ }],
386
+ returns: {
387
+ type: 'Instruction | null'
388
+ },
389
+ signature: '(userData: Record<string | symbol, unknown>) => Instruction | null'
390
+ }, {
391
+ name: 'FeatureFlagClient',
392
+ description: 'Default export. The runtime client developers construct and interact with — it evaluates flags from an in-memory flag set, caches per-key flag wrappers, and fires exposure events through the supplied analytics handler. Construct one instance per app bootstrap and pass it through context.',
393
+ status: 'general-availability',
394
+ usageGuidelines: ['Construct one client per app and pass it through context — do not new up additional clients per component, or duplicate exposures will fire.', 'Provide an `analyticsHandler` at construction time. Constructing without one is an error: the client will throw via `enforceAttributes`.', '`isAutomaticExposuresEnabled` enables the TAC auto-exposure pipeline (downstream consumers opt in). `ignoreTypes: true` disables the runtime type guard on evaluation — only set in tests.', 'Prefer the typed value getters (`getBooleanValue`, `getVariantValue`, `getJSONValue`) over `getRawValue` so wrong-type explanations land in the exposure event.', '`getJSONValue` does not fire an exposure — pair it with `trackFeatureFlag` if the consumer needs an exposure event for the JSON read.', 'If you need to short-circuit exposure firing (e.g. evaluate-then-decide flows), use `shouldTrackExposureEvent: false` paired with an explicit `trackFeatureFlag` call once the decision is made.', '`setFlags` replaces or extends the in-memory flag set and invalidates cached wrappers for any keys it touches; safe to call after a late-arriving bootstrap payload.', '`clear` drops the entire flag set, wrapper cache, and tracked-flag set — primarily useful in tests or when re-bootstrapping after a tenant switch.'],
395
+ keywords: ['feature-flag', 'feature-gate', 'experiment', 'switcheroo', 'FeatureFlagClient', 'client'],
396
+ category: 'experimentation',
397
+ package: '@atlaskit/feature-flag-client',
398
+ examples: [],
399
+ kind: 'constant',
400
+ type: 'class FeatureFlagClient',
401
+ value: 'new FeatureFlagClient({ analyticsHandler, flags?, isAutomaticExposuresEnabled?, ignoreTypes? })\n .setFlags(flags: Flags): void\n .setAnalyticsHandler(analyticsHandler?: AnalyticsHandler): void\n .setIsAutomaticExposuresEnabled(isEnabled: boolean): void\n .getBooleanValue(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): boolean\n .getVariantValue(flagKey, { default, oneOf, exposureData?, shouldTrackExposureEvent? }): string\n .getJSONValue(flagKey): object\n .getRawValue(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): FlagValue\n .getFlagEvaluation<T>(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): FlagShape<T>\n .trackFeatureFlag(flagKey, options?: TrackFeatureFlagOptions): void\n .clear(): void'
402
+ }, {
403
+ name: 'filterSiteProducts',
404
+ description: 'Curried predicate factory. Given a list of products to require, returns a `(site: AvailableSite) => boolean` that keeps sites whose `products` overlap with the required list. Used by the link picker to limit results to sites the user can actually use for the target product.',
405
+ status: 'general-availability',
406
+ keywords: ['utility', 'filterSiteProducts', 'sites', 'linking-common'],
407
+ category: 'linking',
408
+ package: '@atlaskit/linking-common',
409
+ examples: [],
410
+ kind: 'function',
411
+ parameters: [{
412
+ name: 'availableSitesProducts',
413
+ type: 'AvailableSitesProductType[]',
414
+ description: 'Products to require; site is kept if it has at least one of them.'
415
+ }],
416
+ returns: {
417
+ type: '(site: AvailableSite) => boolean',
418
+ description: 'Predicate suitable for `Array.prototype.filter`.'
419
+ },
420
+ signature: '(availableSitesProducts: AvailableSitesProductType[]) => (site: AvailableSite) => boolean'
421
+ }, {
422
+ name: 'FlagValue',
423
+ description: 'Union of the value types a flag can return: `boolean | string | object`.',
424
+ status: 'general-availability',
425
+ keywords: ['feature-flag', 'type', 'FlagValue'],
426
+ category: 'experimentation',
427
+ package: '@atlaskit/feature-flag-client',
428
+ examples: [],
429
+ kind: 'type',
430
+ definition: 'type FlagValue = boolean | string | object'
431
+ }, {
432
+ name: 'getBaseUrl',
433
+ description: 'Resolves the Atlassian gateway base URL for the given environment. Maps `dev`/`development`, `stg`/`staging`, and `prd`/`prod`/`production` to the matching Stargate host. With `envKey === "custom"` it returns `baseUrlOverride` (or prod as a fallback); with no `envKey` and no override it returns `window.location.origin` so calls flow through the Edge Proxy on the current host.',
434
+ status: 'general-availability',
435
+ keywords: ['utility', 'getBaseUrl', 'environment', 'linking-common'],
436
+ category: 'linking',
437
+ package: '@atlaskit/linking-common',
438
+ examples: [],
439
+ kind: 'function',
440
+ parameters: [{
441
+ name: 'envKey',
442
+ type: 'EnvironmentsKeys',
443
+ isOptional: true
444
+ }, {
445
+ name: 'baseUrlOverride',
446
+ type: 'string',
447
+ description: 'Only honoured when `envKey === "custom"`.',
448
+ isOptional: true
449
+ }],
450
+ returns: {
451
+ type: 'string'
452
+ },
453
+ signature: '(envKey?: EnvironmentsKeys, baseUrlOverride?: string) => string'
454
+ }, {
455
+ name: 'getReorderDestinationIndex',
456
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Pure function that returns the array index the dragged item should land at, given the start index, the index of the drop target, the closest edge of that target, and the axis. Use after `extractClosestEdge` to translate edge info into a concrete index for an array splice/move.',
457
+ status: 'general-availability',
458
+ usageGuidelines: ['Use as the final step of a list reorder in `onDrop` — apply the returned index to your array model.'],
459
+ keywords: ['pdnd', 'hitbox', 'getReorderDestinationIndex', 'reorder'],
460
+ category: 'drag-and-drop',
461
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
462
+ examples: [],
463
+ kind: 'function',
464
+ parameters: [{
465
+ name: 'opts',
466
+ type: "{ startIndex: number; closestEdgeOfTarget: Edge | null; indexOfTarget: number; axis: 'vertical' | 'horizontal' }"
467
+ }],
468
+ returns: {
469
+ type: 'number',
470
+ description: 'The destination index. If the start and target indices are the same, or either index is `-1`, the original `startIndex` is returned unchanged.'
471
+ },
472
+ signature: "(opts: { startIndex: number; closestEdgeOfTarget: Edge | null; indexOfTarget: number; axis: 'horizontal' | 'vertical' }) => number"
473
+ }, {
474
+ name: 'getResolverUrl',
475
+ description: 'Returns the object-resolver service URL for the given environment. With no args it returns the Edge Proxy path `/gateway/api/object-resolver` (which fixes cookie issues with strict browser policies); with `envKey` or `baseUrlOverride` it returns the Stargate-direct URL via `getBaseUrl`; with `envKey === "custom"` it returns `baseUrlOverride` (or the Edge Proxy path as a fallback).',
476
+ status: 'general-availability',
477
+ usageGuidelines: ['Prefer the no-args form in the browser — it routes through the Edge Proxy and works correctly with third-party cookie restrictions.', 'Pass `envKey` only when you need to talk to a non-production environment from a different origin (e.g. SSR).'],
478
+ keywords: ['utility', 'getResolverUrl', 'resolver', 'linking-common'],
479
+ category: 'linking',
480
+ package: '@atlaskit/linking-common',
481
+ examples: [],
482
+ kind: 'function',
483
+ parameters: [{
484
+ name: 'envKey',
485
+ type: 'EnvironmentsKeys',
486
+ isOptional: true
487
+ }, {
488
+ name: 'baseUrlOverride',
489
+ type: 'string',
490
+ isOptional: true
491
+ }],
492
+ returns: {
493
+ type: 'string'
494
+ },
495
+ signature: '(envKey?: EnvironmentsKeys, baseUrlOverride?: string) => string'
496
+ }, {
497
+ name: 'getStatus',
498
+ description: 'Derives a `CardType` (Smart Card lifecycle status) from the JSON-LD response meta returned by the resolver. Maps `access: "forbidden"` + `visibility: "not_found"` to either `"not_found"` or `"forbidden"` based on the `requestAccess.accessType`, `access: "unauthorized"` to `"unauthorized"`, and everything else to `"resolved"`.',
499
+ status: 'general-availability',
500
+ usageGuidelines: ['Use anywhere you derive a Smart Card UI state from a fresh resolver response — keeps the access/visibility narrowing in one place.', 'For state already in the Smart Card store (i.e. you already have a `CardState`), read `state.status` directly instead of recomputing.'],
501
+ keywords: ['utility', 'getStatus', 'smart-card', 'json-ld', 'linking-common'],
502
+ category: 'linking',
503
+ package: '@atlaskit/linking-common',
504
+ examples: [],
505
+ kind: 'function',
506
+ parameters: [{
507
+ name: 'meta',
508
+ type: "JsonLd.Response['meta']",
509
+ description: 'The `meta` block from the resolver response.'
510
+ }],
511
+ returns: {
512
+ type: 'CardType'
513
+ },
514
+ signature: "({ meta }: { meta: JsonLd.Response['meta'] }) => CardType"
515
+ }, {
516
+ name: 'getSuspenseResource',
517
+ description: 'Creates a one-shot Suspense resource: `read()` throws a pending promise until the matching `load().complete()` or `load().fail()` is called. Use to drive a component into and out of a Suspense fallback inside a test.',
518
+ status: 'general-availability',
519
+ usageGuidelines: ['Create a fresh resource per test — the internal state machine is one-shot and asserts when `load()` is called twice.', 'Always await `complete()` / `fail()` before making assertions about the post-fallback UI, otherwise React will not have committed the updated tree.'],
520
+ keywords: ['testing', 'suspense', 'react', 'getSuspenseResource'],
521
+ category: 'testing',
522
+ package: '@af/react-unit-testing',
523
+ examples: [],
524
+ kind: 'function',
525
+ parameters: [],
526
+ returns: {
527
+ type: 'TResource',
528
+ description: '`{ read, load }` — `read()` is what a component calls inside render to suspend, `load()` returns `{ complete, fail }` to resolve or reject the pending promise from the test body.'
529
+ },
530
+ signature: '() => TResource'
531
+ }, {
532
+ name: 'getUrl',
533
+ description: 'Selector that pulls the `CardState` for a given URL out of the Smart Card Redux store. Returns `{ status: "pending" }` as a default when no entry exists yet, so consumers can render their pending UI without an explicit null check.',
534
+ status: 'general-availability',
535
+ keywords: ['utility', 'getUrl', 'redux', 'smart-card', 'linking-common'],
536
+ category: 'linking',
537
+ package: '@atlaskit/linking-common',
538
+ examples: [],
539
+ kind: 'function',
540
+ parameters: [{
541
+ name: 'store',
542
+ type: 'Store<CardStore>'
543
+ }, {
544
+ name: 'url',
545
+ type: 'string',
546
+ description: 'Card key (URL).'
547
+ }],
548
+ returns: {
549
+ type: 'CardState'
550
+ },
551
+ signature: '(store: Store<CardStore>, url: string) => CardState'
552
+ }, {
553
+ name: 'InlineCardAdf',
554
+ description: 'ADF node shape for inline Smart Links. Sister types `BlockCardAdf`, `EmbedCardAdf`, and `DatasourceAdf` cover the other appearances. Together `InlineCardAdf | BlockCardAdf | EmbedCardAdf` form `CardAdf`, the union accepted by `@atlaskit/editor-common-types` for Smart Link nodes.',
555
+ status: 'general-availability',
556
+ usageGuidelines: ['Use `CardAdf` when you need to accept any inline/block/embed Smart Link node and the appearance-specific types when you need to discriminate.', '`DatasourceAdf` is structurally a `blockCard` but with a `datasource` attribute — use it explicitly rather than `BlockCardAdf` when working with datasources.'],
557
+ keywords: ['type', 'InlineCardAdf', 'adf', 'smart-card', 'linking-common'],
558
+ category: 'linking',
559
+ package: '@atlaskit/linking-common',
560
+ examples: [],
561
+ kind: 'type',
562
+ definition: "interface InlineCardAdf { type: 'inlineCard'; attrs: { url: string } }"
563
+ }, {
564
+ name: 'Instruction',
565
+ description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Discriminated union describing what a drop on a list item should do. `operation` is one of `reorder-before` | `reorder-after` | `combine`. `blocked: true` signals the operation is logically valid but has been disallowed (so consumers can show a "not allowed" affordance).',
566
+ status: 'general-availability',
567
+ keywords: ['pdnd', 'hitbox', 'Instruction', 'type', 'reorder'],
568
+ category: 'drag-and-drop',
569
+ package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
570
+ examples: [],
571
+ kind: 'type',
572
+ definition: "type Instruction = { operation: 'reorder-before' | 'reorder-after' | 'combine'; blocked: boolean; axis: 'horizontal' | 'vertical' }"
573
+ }, {
574
+ name: 'isUIAnalyticsEvent',
575
+ description: 'Type-guard that returns true if the given value is a `UIAnalyticsEvent` (including instances from older copies of `analytics-next`).',
576
+ status: 'general-availability',
577
+ usageGuidelines: ['Use in listener handlers when you receive events from third-party code and need to narrow before reading `.payload`.'],
578
+ keywords: ['analytics', 'guard', 'isUIAnalyticsEvent', 'analytics-next'],
579
+ category: 'analytics',
580
+ package: '@atlaskit/analytics-next',
581
+ examples: [],
582
+ kind: 'function',
583
+ parameters: [{
584
+ name: 'obj',
585
+ type: 'unknown'
586
+ }],
587
+ returns: {
588
+ type: 'boolean'
589
+ },
590
+ signature: '(obj: unknown) => obj is UIAnalyticsEvent'
591
+ }, {
592
+ name: 'mockWindowStorage',
593
+ description: 'Test helper that replaces `window.localStorage` and/or `window.sessionStorage` with an in-memory `STORAGE_MOCK` so unit tests can exercise storage-dependent code without touching the real browser storage (and without crashing in jsdom environments where storage may be disabled).',
594
+ status: 'general-availability',
595
+ usageGuidelines: ['Call once per test (in `beforeEach`) — each call installs a fresh `STORAGE_MOCK`, so tests are isolated.', 'Handles SSR/jsdom environments where `window` may be undefined — safe to call in any Jest test.', 'Production code must never call this. It is wired up under the `./local-storage` subpath alongside the test mock.'],
596
+ keywords: ['utility', 'mockWindowStorage', 'storage', 'test', 'frontend-utilities'],
597
+ category: 'utilities',
598
+ package: '@atlaskit/frontend-utilities',
599
+ examples: [],
600
+ kind: 'function',
601
+ parameters: [{
602
+ name: 'storageToMock',
603
+ type: "('localStorage' | 'sessionStorage')[]",
604
+ description: 'Which storage objects to replace. Defaults to both.',
605
+ defaultValue: "['localStorage', 'sessionStorage']",
606
+ isOptional: true
607
+ }],
608
+ returns: {
609
+ type: 'void'
610
+ },
611
+ signature: "(storageToMock?: ('localStorage' | 'sessionStorage')[]) => void"
612
+ }, {
613
+ name: 'promiseDebounce',
614
+ description: 'Higher-order helper that returns a debounced wrapper around an async function. Each call cancels the previous pending timeout, so only the final invocation within `time` ms actually runs `cb`. Earlier callers receive promises that remain **pending forever** — they are never rejected.',
615
+ status: 'general-availability',
616
+ usageGuidelines: ['Use for "search-as-you-type" against the resolver — each keystroke gets a promise, but only the last keystroke actually hits the network.', "Earlier callers' promises **stay pending forever** — do not `await` them in a context where you also depend on them rejecting (e.g. with `Promise.race`).", 'Only one timeout is tracked per wrapped function; calls from different callers share the same debounce window.'],
617
+ keywords: ['utility', 'promiseDebounce', 'debounce', 'linking-common'],
618
+ category: 'linking',
619
+ package: '@atlaskit/linking-common',
620
+ examples: [],
621
+ kind: 'function',
622
+ parameters: [{
623
+ name: 'cb',
624
+ type: '(...args: Args) => Promise<ResolveType>'
625
+ }, {
626
+ name: 'time',
627
+ type: 'number',
628
+ description: 'Debounce window in ms.'
629
+ }],
630
+ returns: {
631
+ type: '(...args: Args) => Promise<ResolveType>'
632
+ },
633
+ signature: '<Args extends unknown[], ResolveType>(cb: (...args: Args) => Promise<ResolveType>, time: number) => (...args: Args) => Promise<ResolveType>'
634
+ }, {
635
+ name: 'request',
636
+ description: 'Thin `fetch` wrapper that talks to the linking resolver / ORS. Sets the standard JSON headers, `credentials: "include"`, and only accepts responses whose status is OK or appears in the `statuses` allow-list (default `[200, 401, 404]`). Other statuses cause the raw `Response` to be thrown; string errors and `TypeError`s from the network layer are normalised into a `NetworkError`. Caller is responsible for building the full URL (typically via `getResolverUrl`).',
637
+ status: 'general-availability',
638
+ usageGuidelines: ['Use for any call that targets the linking resolver — do not reach for raw `fetch` so credential and header handling stays consistent.', 'When checking errors, narrow against `NetworkError` first, then handle the `Response` case for non-allow-listed statuses.', '`data` is JSON-stringified unconditionally — do not pass `FormData` or other body types.'],
639
+ keywords: ['utility', 'request', 'fetch', 'resolver', 'linking-common'],
640
+ category: 'linking',
641
+ package: '@atlaskit/linking-common',
642
+ examples: [],
643
+ kind: 'function',
644
+ parameters: [{
645
+ name: 'method',
646
+ type: 'string',
647
+ description: 'HTTP method.'
648
+ }, {
649
+ name: 'url',
650
+ type: 'string',
651
+ description: 'Fully-qualified URL — typically built with `getResolverUrl`.'
652
+ }, {
653
+ name: 'data',
654
+ type: 'any',
655
+ description: 'JSON-serialised into the request body when present.',
656
+ isOptional: true
657
+ }, {
658
+ name: 'headers',
659
+ type: 'HeadersInit',
660
+ description: 'Additional headers — merged on top of the defaults.',
661
+ isOptional: true
662
+ }, {
663
+ name: 'statuses',
664
+ type: 'number[]',
665
+ description: 'Allow-list of non-OK status codes that should still resolve (with the parsed body) rather than throw. Defaults to `[200, 401, 404]`. Include `204` if the response may have an empty body.',
666
+ isOptional: true
667
+ }],
668
+ returns: {
669
+ type: 'Promise<T>',
670
+ description: 'Resolves with the parsed JSON body. Rejects with `NetworkError` for string errors / `TypeError` (typically network failures), or with the raw `Response` for unexpected status codes.'
671
+ },
672
+ signature: '<T = JsonLd.Response>(method: string, url: string, data?: any, headers?: HeadersInit, statuses?: number[]) => Promise<T>'
673
+ }, {
674
+ name: 'resetA11yAuditSkip',
675
+ description: 'Clears the per-test skip flag set by `skipA11yAudit()`. Called automatically by the test setup so consumers rarely invoke this directly.',
676
+ status: 'general-availability',
677
+ usageGuidelines: ['Only call this manually if you are running a custom jest harness that does not already invoke `autoA11yCheck()`.'],
678
+ keywords: ['accessibility', 'a11y', 'resetA11yAuditSkip', 'jest', 'testing'],
679
+ category: 'testing',
680
+ package: '@af/accessibility-testing',
681
+ examples: [],
682
+ kind: 'function',
683
+ signature: '() => void'
684
+ }, {
685
+ name: 'retryOnException',
686
+ description: 'Retries an async `invokeOperation` while the most recent error is in the `retryOn` allow-list, sleeping between attempts per `intervalsMS`. The sleep schedule defines both the number of retries and the delays between them — `intervalsMS: [0, 50, 100]` means "try once, then up to three retries at 0 ms, 50 ms, and 100 ms".',
687
+ status: 'general-availability',
688
+ usageGuidelines: ['Pre-baked schedules live in `@atlaskit/frontend-utilities/retry-operation`: `NO_RETRIES`, `UP_TO_TWO_INSTANT_RETRIES`, `DEFAULT_RETRIES` (`[0, 50, 100]`), `LAZY_LOAD_RETRIES` (`[100, 500, 1000]`). Prefer one of those over hand-rolled arrays so retry semantics stay consistent across products.', '`retryOn` is allow-list, not deny-list — unmatched errors short-circuit and reject immediately. Throw `FailedFetchError` (or your own type that extends `Error`) from inside `invokeOperation` to opt into retries.', '`captureException` should fire-and-forget — do not throw from it, or the retry loop bails. Use it for Sentry reporting on every attempt.'],
689
+ keywords: ['utility', 'retryOnException', 'retry', 'fetch', 'frontend-utilities'],
690
+ category: 'utilities',
691
+ package: '@atlaskit/frontend-utilities',
692
+ examples: [],
693
+ kind: 'function',
694
+ parameters: [{
695
+ name: 'invokeOperation',
696
+ type: '() => Promise<T>',
697
+ description: 'The async operation to attempt. Called once per attempt.'
698
+ }, {
699
+ name: 'config',
700
+ type: '{ intervalsMS?: readonly number[]; retryOn?: (typeof Error)[] | ((e: Error) => boolean); captureException?: (error: Error, tags?: Record<string, string>) => void; onRetry?: (previousErr: Error) => void }',
701
+ description: '`intervalsMS` defaults to `NO_RETRIES` (no retries). `retryOn` defaults to `[FailedFetchError]`. `captureException` is called for every caught error, including the final one. `onRetry` fires only between attempts, never before the first.'
702
+ }],
703
+ returns: {
704
+ type: 'Promise<T>',
705
+ description: 'Resolves with the operation result on the first successful attempt. Rejects with the last caught error once `intervalsMS` is exhausted or an unmatched error is thrown.'
706
+ },
707
+ signature: '<T>(invokeOperation: () => Promise<T>, config: RetryConfig) => Promise<T>'
708
+ }, {
709
+ name: 'shouldSkipA11yTest',
710
+ description: 'Returns true when the current jest test path falls under a package that is excluded from automatic auditing (e.g. tooling-only packages with no React surface).',
711
+ status: 'general-availability',
712
+ usageGuidelines: ['Used internally by `autoA11yCheck()`. Consumers typically should not call this directly — surface a skip via `skipA11yAudit()` instead.'],
713
+ keywords: ['accessibility', 'a11y', 'shouldSkipA11yTest', 'jest', 'testing'],
714
+ category: 'testing',
715
+ package: '@af/accessibility-testing',
716
+ examples: [],
717
+ kind: 'function',
718
+ signature: '() => boolean'
719
+ }, {
720
+ name: 'simpleHash',
721
+ description: 'Deterministic 32-bit string hash rendered in base-36 (e.g. `"hello" -> "y2sl1f"`). Stable across runs for the same input. NOT cryptographic — collisions are easy and the algorithm is not suitable for security.',
722
+ status: 'general-availability',
723
+ usageGuidelines: ['Use for stable cache keys, telemetry-bucket assignments, or generating short anonymous identifiers from a known input.', 'Do NOT use for password hashing, signing, or anything else where collisions or pre-image resistance matter.', 'Output is stable across runtimes — safe to embed in URLs and analytics events.'],
724
+ keywords: ['utility', 'simpleHash', 'hash', 'frontend-utilities'],
725
+ category: 'utilities',
726
+ package: '@atlaskit/frontend-utilities',
727
+ examples: [],
728
+ kind: 'function',
729
+ parameters: [{
730
+ name: 'str',
731
+ type: 'string',
732
+ description: 'Input to hash.'
733
+ }],
734
+ returns: {
735
+ type: 'string',
736
+ description: 'Base-36 representation of a 32-bit signed-to-unsigned hash.'
737
+ },
738
+ signature: '(str: string) => string'
739
+ }, {
740
+ name: 'skipA11yAudit',
741
+ description: 'Marks the current test so that `autoA11yCheck()` skips its audit. The skip is one-shot — it is cleared by `resetA11yAuditSkip()` between tests.',
742
+ status: 'general-availability',
743
+ usageGuidelines: ['Use sparingly. Prefer fixing the violation, or scoping the test to a smaller fixture, before reaching for a skip.', 'Always leave a comment next to the call explaining why the audit is skipped (e.g. tracked violation link or external library limitation).'],
744
+ keywords: ['accessibility', 'a11y', 'skipA11yAudit', 'jest', 'testing'],
745
+ category: 'testing',
746
+ package: '@af/accessibility-testing',
747
+ examples: [],
748
+ kind: 'function',
749
+ signature: '() => void'
750
+ }, {
751
+ name: 'STORAGE_MOCK',
752
+ description: 'In-memory implementation of the DOM `Storage` interface used by `mockWindowStorage`. Exported directly so tests that need their own scoped mock (e.g. for `globalThis` shimming or browser-extension storage) can use it as a building block.',
753
+ status: 'general-availability',
754
+ usageGuidelines: ['Prefer `mockWindowStorage()` for typical Jest setups. Reach for `STORAGE_MOCK` directly only when you need to install storage somewhere other than `window` (e.g. a worker global).', 'The mock is mutable and shared — wrap it with `{ ...STORAGE_MOCK }` before installing if you want per-test isolation manually.'],
755
+ keywords: ['constant', 'STORAGE_MOCK', 'storage', 'test', 'frontend-utilities'],
756
+ category: 'utilities',
757
+ package: '@atlaskit/frontend-utilities',
758
+ examples: [],
759
+ kind: 'constant',
760
+ type: 'Storage',
761
+ value: '{ length: 0; getItem(id); setItem(id, val); removeItem(id); clear(); key(index) } — backed by an in-memory `_data` record.'
762
+ }, {
763
+ name: 'toBeSuspendable',
764
+ description: 'Jest matcher that asserts the given render thunk suspends at least once before settling. Imported for the side effect of registering itself onto `expect`.',
765
+ status: 'general-availability',
766
+ usageGuidelines: ['Pass a thunk that returns a `ReactNode` (`() => <App />`), not a component or an element directly. The matcher needs to re-invoke the thunk across renders.', 'Import the module once from your jest setup file — the matcher self-registers on import.'],
767
+ keywords: ['testing', 'jest', 'matcher', 'suspense', 'toBeSuspendable'],
768
+ category: 'testing',
769
+ package: '@af/react-unit-testing',
770
+ examples: [],
771
+ kind: 'function',
772
+ signature: 'expect(() => ReactNode).toBeSuspendable()'
773
+ }, {
774
+ name: 'toPassStrictMode',
775
+ description: 'Jest matcher that asserts the given component does not log any of the known React Strict Mode warnings (legacy lifecycles, legacy context, etc.).',
776
+ status: 'general-availability',
777
+ usageGuidelines: ['Run on the root component you want to certify — strict-mode warnings bubble down, so a passing root means the whole subtree is clean.', 'Failures print the offending warning verbatim. Resolve by migrating off the deprecated API rather than suppressing the warning.'],
778
+ keywords: ['testing', 'jest', 'matcher', 'strict-mode', 'toPassStrictMode'],
779
+ category: 'testing',
780
+ package: '@af/react-unit-testing',
781
+ examples: [],
782
+ kind: 'function',
783
+ signature: 'expect(() => ReactNode).toPassStrictMode()'
784
+ }, {
785
+ name: 'TResource',
786
+ description: 'Public shape of the value returned by `getSuspenseResource()`. Useful when stashing a resource on a ref or passing it between helpers.',
787
+ status: 'general-availability',
788
+ keywords: ['testing', 'suspense', 'type', 'TResource'],
789
+ category: 'testing',
790
+ package: '@af/react-unit-testing',
791
+ examples: [],
792
+ kind: 'type',
793
+ definition: 'type TResource = { read: () => void | never; load: () => { complete: () => Promise<void>; fail: () => Promise<void> } }'
794
+ }, {
795
+ name: 'UIAnalyticsEventHandler',
796
+ description: 'Signature for any function that receives events from an `AnalyticsListener`. Implement to forward events to your analytics SDK.',
797
+ status: 'general-availability',
798
+ usageGuidelines: ['Handlers must not throw — analytics must never crash product UI. The runtime swallows handler errors in production and logs them in development.'],
799
+ keywords: ['analytics', 'type', 'handler', 'UIAnalyticsEventHandler', 'analytics-next'],
800
+ category: 'analytics',
801
+ package: '@atlaskit/analytics-next',
802
+ examples: [],
803
+ kind: 'type',
804
+ definition: '(event: UIAnalyticsEvent, channel?: string) => void'
805
+ }, {
806
+ name: 'withFeatureFlaggedComponent',
807
+ description: 'Higher-order component that swaps between two implementations based on a feature-gate function. Lets a package ship a new component behind a gate without forking the consuming call sites. The gate function is invoked per render — pass `() => fg("my_gate_name")`.',
808
+ status: 'general-availability',
809
+ usageGuidelines: ['`featureFlagFn` is a callback, not a string — it lets the wrapper stay agnostic to which flag system you use (`fg`, Statsig, etc.).', 'Argument order is `(Old, New, gateFn)` — the old component first matches the migration mental model.', 'Test both branches with `passGate` / `failGate` from `@atlassian/feature-flags-test-utils/mock-gates`.', 'Keep both implementations source-compatible — props must be the same shape, or the swap will break call sites.'],
810
+ keywords: ['utility', 'withFeatureFlaggedComponent', 'feature-flag', 'hoc', 'linking-common'],
811
+ category: 'linking',
812
+ package: '@atlaskit/linking-common',
813
+ examples: [],
814
+ kind: 'function',
815
+ parameters: [{
816
+ name: 'ComponentOld',
817
+ type: 'ComponentType<P>'
818
+ }, {
819
+ name: 'ComponentNext',
820
+ type: 'ComponentType<P>'
821
+ }, {
822
+ name: 'featureFlagFn',
823
+ type: '() => boolean',
824
+ description: 'Evaluated each render. Typically `() => fg("gate_name")`.'
825
+ }],
826
+ returns: {
827
+ type: '(props: P) => JSX.Element'
828
+ },
829
+ signature: '<P extends object>(ComponentOld: ComponentType<P>, ComponentNext: ComponentType<P>, featureFlagFn: () => boolean) => (props: P) => JSX.Element'
830
+ }];