@atlaskit/adf-utils 18.2.0 → 18.2.2

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 (194) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/builders/package.json +2 -2
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/es2019/version.json +1 -1
  5. package/dist/esm/version.json +1 -1
  6. package/dist/types/builders/nodes/code-block.d.ts +1 -1
  7. package/dist/types/builders/nodes/table-cell.d.ts +1 -1
  8. package/dist/types/builders/nodes/table-header.d.ts +1 -1
  9. package/dist/types/builders/types.d.ts +2 -2
  10. package/dist/types/scrub/default-node-replacements.d.ts +2 -2
  11. package/dist/types/scrub/default-value-replacements.d.ts +3 -3
  12. package/dist/types/scrub/scrub-content.d.ts +1 -1
  13. package/dist/types/types/index.d.ts +3 -3
  14. package/dist/types/types/validatorTypes.d.ts +8 -8
  15. package/dist/types-ts4.5/builders/marks/alignment.d.ts +3 -0
  16. package/dist/types-ts4.5/builders/marks/annotation.d.ts +3 -0
  17. package/dist/types-ts4.5/builders/marks/border.d.ts +3 -0
  18. package/dist/types-ts4.5/builders/marks/breakout.d.ts +3 -0
  19. package/dist/types-ts4.5/builders/marks/code.d.ts +2 -0
  20. package/dist/types-ts4.5/builders/marks/data-consumer.d.ts +3 -0
  21. package/dist/types-ts4.5/builders/marks/em.d.ts +2 -0
  22. package/dist/types-ts4.5/builders/marks/fragment.d.ts +3 -0
  23. package/dist/types-ts4.5/builders/marks/indentation.d.ts +3 -0
  24. package/dist/types-ts4.5/builders/marks/link.d.ts +3 -0
  25. package/dist/types-ts4.5/builders/marks/strike.d.ts +2 -0
  26. package/dist/types-ts4.5/builders/marks/strong.d.ts +2 -0
  27. package/dist/types-ts4.5/builders/marks/subsup.d.ts +3 -0
  28. package/dist/types-ts4.5/builders/marks/text-color.d.ts +3 -0
  29. package/dist/types-ts4.5/builders/marks/underline.d.ts +2 -0
  30. package/dist/types-ts4.5/builders/nodes/block-card.d.ts +2 -0
  31. package/dist/types-ts4.5/builders/nodes/blockquote.d.ts +2 -0
  32. package/dist/types-ts4.5/builders/nodes/bodied-extension.d.ts +2 -0
  33. package/dist/types-ts4.5/builders/nodes/bullet-list.d.ts +2 -0
  34. package/dist/types-ts4.5/builders/nodes/caption.d.ts +2 -0
  35. package/dist/types-ts4.5/builders/nodes/code-block.d.ts +3 -0
  36. package/dist/types-ts4.5/builders/nodes/date.d.ts +2 -0
  37. package/dist/types-ts4.5/builders/nodes/decision-item.d.ts +2 -0
  38. package/dist/types-ts4.5/builders/nodes/decision-list.d.ts +2 -0
  39. package/dist/types-ts4.5/builders/nodes/doc.d.ts +2 -0
  40. package/dist/types-ts4.5/builders/nodes/embed-card.d.ts +2 -0
  41. package/dist/types-ts4.5/builders/nodes/emoji.d.ts +2 -0
  42. package/dist/types-ts4.5/builders/nodes/expand.d.ts +2 -0
  43. package/dist/types-ts4.5/builders/nodes/extension.d.ts +2 -0
  44. package/dist/types-ts4.5/builders/nodes/hard-break.d.ts +2 -0
  45. package/dist/types-ts4.5/builders/nodes/heading.d.ts +2 -0
  46. package/dist/types-ts4.5/builders/nodes/inline-card.d.ts +2 -0
  47. package/dist/types-ts4.5/builders/nodes/inline-extension.d.ts +2 -0
  48. package/dist/types-ts4.5/builders/nodes/layout-column.d.ts +4 -0
  49. package/dist/types-ts4.5/builders/nodes/layout-section.d.ts +2 -0
  50. package/dist/types-ts4.5/builders/nodes/list-item.d.ts +2 -0
  51. package/dist/types-ts4.5/builders/nodes/media-group.d.ts +2 -0
  52. package/dist/types-ts4.5/builders/nodes/media-inline.d.ts +2 -0
  53. package/dist/types-ts4.5/builders/nodes/media-single.d.ts +7 -0
  54. package/dist/types-ts4.5/builders/nodes/media.d.ts +2 -0
  55. package/dist/types-ts4.5/builders/nodes/mention.d.ts +2 -0
  56. package/dist/types-ts4.5/builders/nodes/nested-expand.d.ts +2 -0
  57. package/dist/types-ts4.5/builders/nodes/ordered-list.d.ts +2 -0
  58. package/dist/types-ts4.5/builders/nodes/panel.d.ts +2 -0
  59. package/dist/types-ts4.5/builders/nodes/paragraph.d.ts +2 -0
  60. package/dist/types-ts4.5/builders/nodes/placeholder.d.ts +2 -0
  61. package/dist/types-ts4.5/builders/nodes/rule.d.ts +2 -0
  62. package/dist/types-ts4.5/builders/nodes/status.d.ts +2 -0
  63. package/dist/types-ts4.5/builders/nodes/table-cell.d.ts +2 -0
  64. package/dist/types-ts4.5/builders/nodes/table-header.d.ts +2 -0
  65. package/dist/types-ts4.5/builders/nodes/table-row.d.ts +2 -0
  66. package/dist/types-ts4.5/builders/nodes/table.d.ts +2 -0
  67. package/dist/types-ts4.5/builders/nodes/task-item.d.ts +2 -0
  68. package/dist/types-ts4.5/builders/nodes/task-list.d.ts +2 -0
  69. package/dist/types-ts4.5/builders/nodes/text.d.ts +2 -0
  70. package/dist/types-ts4.5/builders/types.d.ts +8 -0
  71. package/dist/types-ts4.5/builders/utils/apply-mark.d.ts +4 -0
  72. package/dist/types-ts4.5/builders/utils/create-text-nodes.d.ts +3 -0
  73. package/dist/types-ts4.5/builders/utils/is-duplicate-mark.d.ts +6 -0
  74. package/dist/types-ts4.5/builders.d.ts +64 -0
  75. package/dist/types-ts4.5/empty-adf.d.ts +2 -0
  76. package/dist/types-ts4.5/index.d.ts +1 -0
  77. package/dist/types-ts4.5/scrub/default-node-replacements.d.ts +10 -0
  78. package/dist/types-ts4.5/scrub/default-value-replacements.d.ts +6 -0
  79. package/dist/types-ts4.5/scrub/hash.d.ts +1 -0
  80. package/dist/types-ts4.5/scrub/scrub-adf.d.ts +9 -0
  81. package/dist/types-ts4.5/scrub/scrub-content.d.ts +11 -0
  82. package/dist/types-ts4.5/scrub.d.ts +1 -0
  83. package/dist/types-ts4.5/transforms/dedupe-marks-transform.d.ts +8 -0
  84. package/dist/types-ts4.5/transforms/helpers.d.ts +2 -0
  85. package/dist/types-ts4.5/transforms/indentation-marks-transform.d.ts +7 -0
  86. package/dist/types-ts4.5/transforms/invalid-media-content-transform.d.ts +5 -0
  87. package/dist/types-ts4.5/transforms/media-link-transform.d.ts +5 -0
  88. package/dist/types-ts4.5/transforms/nodes-missing-content-transform.d.ts +7 -0
  89. package/dist/types-ts4.5/transforms/text-link-code-transform.d.ts +5 -0
  90. package/dist/types-ts4.5/transforms.d.ts +6 -0
  91. package/dist/types-ts4.5/traverse/filter.d.ts +2 -0
  92. package/dist/types-ts4.5/traverse/map.d.ts +2 -0
  93. package/dist/types-ts4.5/traverse/reduce.d.ts +2 -0
  94. package/dist/types-ts4.5/traverse/traverse.d.ts +12 -0
  95. package/dist/types-ts4.5/traverse.d.ts +4 -0
  96. package/dist/types-ts4.5/types/index.d.ts +24 -0
  97. package/dist/types-ts4.5/types/validatorTypes.d.ts +137 -0
  98. package/dist/types-ts4.5/validator/entry.d.ts +1 -0
  99. package/dist/types-ts4.5/validator/rules.d.ts +3 -0
  100. package/dist/types-ts4.5/validator/specs/alignment.d.ts +17 -0
  101. package/dist/types-ts4.5/validator/specs/annotation.d.ts +20 -0
  102. package/dist/types-ts4.5/validator/specs/atomic_inline.d.ts +2 -0
  103. package/dist/types-ts4.5/validator/specs/blockCard.d.ts +26 -0
  104. package/dist/types-ts4.5/validator/specs/block_content.d.ts +2 -0
  105. package/dist/types-ts4.5/validator/specs/blockquote.d.ts +15 -0
  106. package/dist/types-ts4.5/validator/specs/bodiedExtension.d.ts +50 -0
  107. package/dist/types-ts4.5/validator/specs/bodiedExtension_with_marks.d.ts +10 -0
  108. package/dist/types-ts4.5/validator/specs/border.d.ts +22 -0
  109. package/dist/types-ts4.5/validator/specs/breakout.d.ts +17 -0
  110. package/dist/types-ts4.5/validator/specs/bulletList.d.ts +14 -0
  111. package/dist/types-ts4.5/validator/specs/caption.d.ts +14 -0
  112. package/dist/types-ts4.5/validator/specs/code.d.ts +9 -0
  113. package/dist/types-ts4.5/validator/specs/codeBlock.d.ts +38 -0
  114. package/dist/types-ts4.5/validator/specs/codeBlock_with_marks.d.ts +10 -0
  115. package/dist/types-ts4.5/validator/specs/codeBlock_with_no_marks.d.ts +11 -0
  116. package/dist/types-ts4.5/validator/specs/code_inline.d.ts +10 -0
  117. package/dist/types-ts4.5/validator/specs/dataConsumer.d.ts +20 -0
  118. package/dist/types-ts4.5/validator/specs/date.d.ts +17 -0
  119. package/dist/types-ts4.5/validator/specs/decisionItem.d.ts +25 -0
  120. package/dist/types-ts4.5/validator/specs/decisionList.d.ts +22 -0
  121. package/dist/types-ts4.5/validator/specs/doc.d.ts +18 -0
  122. package/dist/types-ts4.5/validator/specs/em.d.ts +9 -0
  123. package/dist/types-ts4.5/validator/specs/embedCard.d.ts +35 -0
  124. package/dist/types-ts4.5/validator/specs/emoji.d.ts +24 -0
  125. package/dist/types-ts4.5/validator/specs/expand.d.ts +28 -0
  126. package/dist/types-ts4.5/validator/specs/expand_with_breakout_mark.d.ts +10 -0
  127. package/dist/types-ts4.5/validator/specs/expand_with_no_mark.d.ts +11 -0
  128. package/dist/types-ts4.5/validator/specs/extension.d.ts +44 -0
  129. package/dist/types-ts4.5/validator/specs/extension_with_marks.d.ts +10 -0
  130. package/dist/types-ts4.5/validator/specs/formatted_text_inline.d.ts +10 -0
  131. package/dist/types-ts4.5/validator/specs/fragment.d.ts +21 -0
  132. package/dist/types-ts4.5/validator/specs/hardBreak.d.ts +19 -0
  133. package/dist/types-ts4.5/validator/specs/heading.d.ts +29 -0
  134. package/dist/types-ts4.5/validator/specs/heading_with_alignment.d.ts +10 -0
  135. package/dist/types-ts4.5/validator/specs/heading_with_indentation.d.ts +10 -0
  136. package/dist/types-ts4.5/validator/specs/heading_with_no_marks.d.ts +11 -0
  137. package/dist/types-ts4.5/validator/specs/indentation.d.ts +18 -0
  138. package/dist/types-ts4.5/validator/specs/index.d.ts +83 -0
  139. package/dist/types-ts4.5/validator/specs/inline.d.ts +2 -0
  140. package/dist/types-ts4.5/validator/specs/inlineCard.d.ts +26 -0
  141. package/dist/types-ts4.5/validator/specs/inlineExtension.d.ts +39 -0
  142. package/dist/types-ts4.5/validator/specs/inlineExtension_with_marks.d.ts +10 -0
  143. package/dist/types-ts4.5/validator/specs/inline_comment_marker.d.ts +16 -0
  144. package/dist/types-ts4.5/validator/specs/layoutColumn.d.ts +24 -0
  145. package/dist/types-ts4.5/validator/specs/layoutSection.d.ts +18 -0
  146. package/dist/types-ts4.5/validator/specs/layoutSection_full.d.ts +21 -0
  147. package/dist/types-ts4.5/validator/specs/layoutSection_with_single_column.d.ts +21 -0
  148. package/dist/types-ts4.5/validator/specs/link.d.ts +33 -0
  149. package/dist/types-ts4.5/validator/specs/link_text_inline.d.ts +10 -0
  150. package/dist/types-ts4.5/validator/specs/listItem.d.ts +15 -0
  151. package/dist/types-ts4.5/validator/specs/media.d.ts +73 -0
  152. package/dist/types-ts4.5/validator/specs/mediaGroup.d.ts +15 -0
  153. package/dist/types-ts4.5/validator/specs/mediaInline.d.ts +51 -0
  154. package/dist/types-ts4.5/validator/specs/mediaSingle.d.ts +29 -0
  155. package/dist/types-ts4.5/validator/specs/mediaSingle_caption.d.ts +13 -0
  156. package/dist/types-ts4.5/validator/specs/mediaSingle_full.d.ts +12 -0
  157. package/dist/types-ts4.5/validator/specs/mention.d.ts +29 -0
  158. package/dist/types-ts4.5/validator/specs/nestedExpand.d.ts +19 -0
  159. package/dist/types-ts4.5/validator/specs/nestedExpand_content.d.ts +7 -0
  160. package/dist/types-ts4.5/validator/specs/nestedExpand_with_no_marks.d.ts +11 -0
  161. package/dist/types-ts4.5/validator/specs/non_nestable_block_content.d.ts +2 -0
  162. package/dist/types-ts4.5/validator/specs/orderedList.d.ts +24 -0
  163. package/dist/types-ts4.5/validator/specs/panel.d.ts +39 -0
  164. package/dist/types-ts4.5/validator/specs/paragraph.d.ts +20 -0
  165. package/dist/types-ts4.5/validator/specs/paragraph_with_alignment.d.ts +10 -0
  166. package/dist/types-ts4.5/validator/specs/paragraph_with_indentation.d.ts +10 -0
  167. package/dist/types-ts4.5/validator/specs/paragraph_with_no_marks.d.ts +11 -0
  168. package/dist/types-ts4.5/validator/specs/placeholder.d.ts +16 -0
  169. package/dist/types-ts4.5/validator/specs/rule.d.ts +9 -0
  170. package/dist/types-ts4.5/validator/specs/status.d.ts +29 -0
  171. package/dist/types-ts4.5/validator/specs/strike.d.ts +9 -0
  172. package/dist/types-ts4.5/validator/specs/strong.d.ts +9 -0
  173. package/dist/types-ts4.5/validator/specs/subsup.d.ts +17 -0
  174. package/dist/types-ts4.5/validator/specs/table.d.ts +38 -0
  175. package/dist/types-ts4.5/validator/specs/tableCell.d.ts +35 -0
  176. package/dist/types-ts4.5/validator/specs/tableCell_content.d.ts +7 -0
  177. package/dist/types-ts4.5/validator/specs/tableHeader.d.ts +35 -0
  178. package/dist/types-ts4.5/validator/specs/tableRow.d.ts +13 -0
  179. package/dist/types-ts4.5/validator/specs/taskItem.d.ts +26 -0
  180. package/dist/types-ts4.5/validator/specs/taskList.d.ts +23 -0
  181. package/dist/types-ts4.5/validator/specs/text.d.ts +18 -0
  182. package/dist/types-ts4.5/validator/specs/textColor.d.ts +17 -0
  183. package/dist/types-ts4.5/validator/specs/underline.d.ts +9 -0
  184. package/dist/types-ts4.5/validator/utils.d.ts +8 -0
  185. package/dist/types-ts4.5/validator/validator.d.ts +3 -0
  186. package/dist/types-ts4.5/validator.d.ts +1 -0
  187. package/empty-adf/package.json +2 -2
  188. package/package.json +10 -2
  189. package/scrub/package.json +2 -2
  190. package/transforms/package.json +2 -2
  191. package/traverse/package.json +2 -2
  192. package/types/package.json +2 -2
  193. package/validator/package.json +2 -2
  194. package/validatorTypes/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-utils
2
2
 
3
+ ## 18.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
9
+ ## 18.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 18.2.0
4
16
 
5
17
  ### Minor Changes
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/builders.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/builders.d.ts"
11
+ "../dist/types-ts4.5/builders.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.2.0",
3
+ "version": "18.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.2.0",
3
+ "version": "18.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.2.0",
3
+ "version": "18.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,3 @@
1
1
  import { CodeBlockDefinition, TextDefinition, NoMark } from '@atlaskit/adf-schema';
2
- export declare type CodeBlockContent = TextDefinition & NoMark;
2
+ export type CodeBlockContent = TextDefinition & NoMark;
3
3
  export declare const codeBlock: (attrs: CodeBlockDefinition['attrs'] | undefined) => (...content: Array<CodeBlockContent>) => CodeBlockDefinition;
@@ -1,2 +1,2 @@
1
1
  import { TableCellDefinition, CellAttributes } from '@atlaskit/adf-schema';
2
- export declare const tableCell: (attrs?: CellAttributes | undefined) => (...content: TableCellDefinition['content']) => TableCellDefinition;
2
+ export declare const tableCell: (attrs?: CellAttributes) => (...content: TableCellDefinition['content']) => TableCellDefinition;
@@ -1,2 +1,2 @@
1
1
  import { TableHeaderDefinition, CellAttributes } from '@atlaskit/adf-schema';
2
- export declare const tableHeader: (attrs?: CellAttributes | undefined) => (...content: TableHeaderDefinition['content']) => TableHeaderDefinition;
2
+ export declare const tableHeader: (attrs?: CellAttributes) => (...content: TableHeaderDefinition['content']) => TableHeaderDefinition;
@@ -1,8 +1,8 @@
1
- export declare type WithMark = {
1
+ export type WithMark = {
2
2
  type: any;
3
3
  marks?: Array<any>;
4
4
  [prop: string]: any;
5
5
  };
6
- export declare type WithAppliedMark<T, M> = T & {
6
+ export type WithAppliedMark<T, M> = T & {
7
7
  marks?: Array<M>;
8
8
  };
@@ -1,10 +1,10 @@
1
1
  import { ADFEntity, EntityParent } from '../types';
2
2
  import { ValueReplacements } from './default-value-replacements';
3
- export declare type NodeReplacer = (node: ADFEntity, context: {
3
+ export type NodeReplacer = (node: ADFEntity, context: {
4
4
  parent: EntityParent;
5
5
  valueReplacements: ValueReplacements;
6
6
  }) => ADFEntity | null | false;
7
- export declare type NodeReplacements = {
7
+ export type NodeReplacements = {
8
8
  [key: string]: NodeReplacer;
9
9
  };
10
10
  export declare const defaultNodeReplacements: NodeReplacements;
@@ -1,6 +1,6 @@
1
- export declare type Value = string | number | boolean | undefined | null;
2
- export declare type ValueReplacer<V extends Value> = (value: V) => V;
3
- export declare type ValueReplacements = {
1
+ export type Value = string | number | boolean | undefined | null;
2
+ export type ValueReplacer<V extends Value> = (value: V) => V;
3
+ export type ValueReplacements = {
4
4
  href: ValueReplacer<string>;
5
5
  };
6
6
  export declare const defaultValueReplacements: ValueReplacements;
@@ -1,6 +1,6 @@
1
1
  import { ValueReplacements } from './default-value-replacements';
2
2
  export declare const scrubStr: (val: string, offset?: number) => string;
3
- export declare type ScrubLinkOptions = {
3
+ export type ScrubLinkOptions = {
4
4
  valueReplacements: ValueReplacements;
5
5
  };
6
6
  export declare const scrubLink: (marks: {
@@ -14,11 +14,11 @@ export interface ADFEntity {
14
14
  text?: string;
15
15
  [key: string]: any;
16
16
  }
17
- export declare type Visitor = (node: ADFEntity, parent: EntityParent, index: number, depth: number) => ADFEntity | false | undefined | void;
18
- export declare type VisitorCollection = {
17
+ export type Visitor = (node: ADFEntity, parent: EntityParent, index: number, depth: number) => ADFEntity | false | undefined | void;
18
+ export type VisitorCollection = {
19
19
  [nodeType: string]: Visitor;
20
20
  };
21
- export declare type EntityParent = {
21
+ export type EntityParent = {
22
22
  node?: ADFEntity;
23
23
  parent?: EntityParent;
24
24
  };
@@ -25,7 +25,7 @@ export interface ValidatorContent {
25
25
  allowUnsupportedInline: boolean;
26
26
  isTupleLike?: boolean;
27
27
  }
28
- export declare type AttributesSpec = {
28
+ export type AttributesSpec = {
29
29
  type: 'number';
30
30
  optional?: boolean;
31
31
  minimum: number;
@@ -106,16 +106,16 @@ export interface ValidationErrorMap {
106
106
  };
107
107
  DEPRECATED: never;
108
108
  }
109
- export declare type RequiredContentLength = 'minimum' | 'maximum';
110
- export declare type Content = Array<string | [string, object] | Array<string>>;
111
- export declare type ValidationErrorType = keyof ValidationErrorMap;
109
+ export type RequiredContentLength = 'minimum' | 'maximum';
110
+ export type Content = Array<string | [string, object] | Array<string>>;
111
+ export type ValidationErrorType = keyof ValidationErrorMap;
112
112
  export interface ValidationError {
113
113
  code: ValidationErrorType;
114
114
  message: string;
115
115
  meta?: object;
116
116
  }
117
- export declare type ErrorCallback = (entity: ADFEntity, error: ValidationError, options: ErrorCallbackOptions) => ADFEntity | undefined;
118
- export declare type ValidationMode = 'strict' | 'loose';
117
+ export type ErrorCallback = (entity: ADFEntity, error: ValidationError, options: ErrorCallbackOptions) => ADFEntity | undefined;
118
+ export type ValidationMode = 'strict' | 'loose';
119
119
  export interface ValidationOptions {
120
120
  mode?: ValidationMode;
121
121
  allowPrivateAttributes?: boolean;
@@ -124,11 +124,11 @@ export interface SpecValidatorResult {
124
124
  hasValidated: boolean;
125
125
  result?: NodeValidationResult;
126
126
  }
127
- export declare type Err = <T extends ValidationErrorType>(code: T, msg: string, meta?: T extends keyof ValidationErrorMap ? ValidationErrorMap[T] : never) => NodeValidationResult;
127
+ export type Err = <T extends ValidationErrorType>(code: T, msg: string, meta?: T extends keyof ValidationErrorMap ? ValidationErrorMap[T] : never) => NodeValidationResult;
128
128
  export interface ErrorCallbackOptions {
129
129
  isNodeAttribute?: boolean;
130
130
  isMark?: any;
131
131
  allowUnsupportedBlock?: boolean;
132
132
  allowUnsupportedInline?: boolean;
133
133
  }
134
- export declare type Validate = (entity: ADFEntity, errorCallback?: ErrorCallback, allowed?: Content, parentSpec?: ValidatorSpec) => Output;
134
+ export type Validate = (entity: ADFEntity, errorCallback?: ErrorCallback, allowed?: Content, parentSpec?: ValidatorSpec) => Output;
@@ -0,0 +1,3 @@
1
+ import { AlignmentMarkDefinition, AlignmentAttributes, ParagraphDefinition, HeadingDefinition } from '@atlaskit/adf-schema';
2
+ import { WithMark, WithAppliedMark } from '../types';
3
+ export declare const alignment: (attrs: AlignmentAttributes) => (maybeNode: WithMark | string) => WithAppliedMark<ParagraphDefinition | HeadingDefinition, AlignmentMarkDefinition>;
@@ -0,0 +1,3 @@
1
+ import { AnnotationMarkAttributes } from '@atlaskit/adf-schema';
2
+ import { WithMark } from '../types';
3
+ export declare const annotation: (attrs: AnnotationMarkAttributes) => (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,3 @@
1
+ import { BorderMarkAttributes } from '@atlaskit/adf-schema';
2
+ import { WithMark } from '../types';
3
+ export declare const border: (attrs: BorderMarkAttributes) => (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,3 @@
1
+ import { BreakoutMarkAttrs, BreakoutMarkDefinition, CodeBlockDefinition, LayoutSectionDefinition } from '@atlaskit/adf-schema';
2
+ import { WithAppliedMark } from '../types';
3
+ export declare const breakout: (attrs: BreakoutMarkAttrs) => (maybeNode: CodeBlockDefinition | LayoutSectionDefinition) => WithAppliedMark<CodeBlockDefinition | LayoutSectionDefinition, BreakoutMarkDefinition>;
@@ -0,0 +1,2 @@
1
+ import { WithMark } from '../types';
2
+ export declare const code: (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,3 @@
1
+ import { ExtensionDefinition, BodiedExtensionDefinition, InlineExtensionDefinition, DataConsumerAttributes, DataConsumerDefinition } from '@atlaskit/adf-schema';
2
+ import { WithAppliedMark } from '../types';
3
+ export declare const dataConsumer: (attrs: DataConsumerAttributes) => (maybeNode: ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition) => WithAppliedMark<ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition, DataConsumerDefinition>;
@@ -0,0 +1,2 @@
1
+ import { WithMark } from '../types';
2
+ export declare const em: (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,3 @@
1
+ import { ExtensionDefinition, BodiedExtensionDefinition, InlineExtensionDefinition, TableDefinition, FragmentAttributes, FragmentDefinition } from '@atlaskit/adf-schema';
2
+ import { WithAppliedMark } from '../types';
3
+ export declare const fragment: (attrs: FragmentAttributes) => (maybeNode: TableDefinition | ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition) => WithAppliedMark<ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition | TableDefinition, FragmentDefinition>;
@@ -0,0 +1,3 @@
1
+ import { IndentationMarkDefinition, IndentationMarkAttributes, ParagraphDefinition } from '@atlaskit/adf-schema';
2
+ import { WithMark, WithAppliedMark } from '../types';
3
+ export declare const indentation: (attrs: IndentationMarkAttributes) => (maybeNode: WithMark | string) => WithAppliedMark<ParagraphDefinition, IndentationMarkDefinition>;
@@ -0,0 +1,3 @@
1
+ import { LinkAttributes } from '@atlaskit/adf-schema';
2
+ import { WithMark } from '../types';
3
+ export declare const link: (attrs: LinkAttributes) => (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,2 @@
1
+ import { WithMark } from '../types';
2
+ export declare const strike: (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,2 @@
1
+ import { WithMark } from '../types';
2
+ export declare const strong: (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,3 @@
1
+ import { SubSupAttributes } from '@atlaskit/adf-schema';
2
+ import { WithMark } from '../types';
3
+ export declare const subsup: (attrs: SubSupAttributes) => (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,3 @@
1
+ import { TextColorAttributes } from '@atlaskit/adf-schema';
2
+ import { WithMark } from '../types';
3
+ export declare const textColor: (attrs: TextColorAttributes) => (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,2 @@
1
+ import { WithMark } from '../types';
2
+ export declare const underline: (maybeNode: WithMark | string) => WithMark;
@@ -0,0 +1,2 @@
1
+ import { BlockCardDefinition, CardAttributes } from '@atlaskit/adf-schema';
2
+ export declare const blockCard: (attrs: CardAttributes) => BlockCardDefinition;
@@ -0,0 +1,2 @@
1
+ import { ParagraphDefinition, BlockQuoteDefinition } from '@atlaskit/adf-schema';
2
+ export declare const blockQuote: (...content: Array<ParagraphDefinition>) => BlockQuoteDefinition;
@@ -0,0 +1,2 @@
1
+ import { BodiedExtensionDefinition, NonNestableBlockContent } from '@atlaskit/adf-schema';
2
+ export declare const bodiedExtension: (attrs: BodiedExtensionDefinition['attrs']) => (...content: Array<NonNestableBlockContent>) => BodiedExtensionDefinition;
@@ -0,0 +1,2 @@
1
+ import { BulletListDefinition, ListItemDefinition } from '@atlaskit/adf-schema';
2
+ export declare const bulletList: (...content: Array<ListItemDefinition>) => BulletListDefinition;
@@ -0,0 +1,2 @@
1
+ import { CaptionDefinition } from '@atlaskit/adf-schema';
2
+ export declare const caption: (...content: CaptionDefinition['content']) => CaptionDefinition;
@@ -0,0 +1,3 @@
1
+ import { CodeBlockDefinition, TextDefinition, NoMark } from '@atlaskit/adf-schema';
2
+ export type CodeBlockContent = TextDefinition & NoMark;
3
+ export declare const codeBlock: (attrs: CodeBlockDefinition['attrs'] | undefined) => (...content: Array<CodeBlockContent>) => CodeBlockDefinition;
@@ -0,0 +1,2 @@
1
+ import { DateDefinition } from '@atlaskit/adf-schema';
2
+ export declare const date: (attrs?: DateDefinition['attrs']) => DateDefinition;
@@ -0,0 +1,2 @@
1
+ import { DecisionItemDefinition, Inline } from '@atlaskit/adf-schema';
2
+ export declare const decisionItem: (attrs: DecisionItemDefinition['attrs']) => (...content: Array<Inline>) => DecisionItemDefinition;
@@ -0,0 +1,2 @@
1
+ import { DecisionListDefinition, DecisionItemDefinition } from '@atlaskit/adf-schema';
2
+ export declare const decisionList: (attrs: DecisionListDefinition['attrs']) => (...content: Array<DecisionItemDefinition>) => DecisionListDefinition;
@@ -0,0 +1,2 @@
1
+ import { DocNode, BlockContent, LayoutSectionDefinition } from '@atlaskit/adf-schema';
2
+ export declare const doc: (...content: Array<BlockContent | LayoutSectionDefinition>) => DocNode;
@@ -0,0 +1,2 @@
1
+ import { EmbedCardDefinition, EmbedCardAttributes } from '@atlaskit/adf-schema';
2
+ export declare const embedCard: (attrs: EmbedCardAttributes) => EmbedCardDefinition;
@@ -0,0 +1,2 @@
1
+ import { EmojiDefinition, EmojiAttributes } from '@atlaskit/adf-schema';
2
+ export declare const emoji: (attrs: EmojiAttributes) => EmojiDefinition;
@@ -0,0 +1,2 @@
1
+ import { ExpandDefinition, NonNestableBlockContent } from '@atlaskit/adf-schema';
2
+ export declare const expand: (attrs: ExpandDefinition['attrs']) => (...content: Array<NonNestableBlockContent>) => ExpandDefinition;
@@ -0,0 +1,2 @@
1
+ import { ExtensionDefinition } from '@atlaskit/adf-schema';
2
+ export declare const extension: (attrs: ExtensionDefinition['attrs']) => ExtensionDefinition;
@@ -0,0 +1,2 @@
1
+ import { HardBreakDefinition } from '@atlaskit/adf-schema';
2
+ export declare const hardBreak: (attrs?: HardBreakDefinition['attrs']) => HardBreakDefinition;
@@ -0,0 +1,2 @@
1
+ import { Inline, HeadingDefinition } from '@atlaskit/adf-schema';
2
+ export declare const heading: (attrs: HeadingDefinition['attrs']) => (...content: Array<Inline>) => HeadingDefinition;
@@ -0,0 +1,2 @@
1
+ import { InlineCardDefinition, CardAttributes } from '@atlaskit/adf-schema';
2
+ export declare const inlineCard: (attrs: CardAttributes) => InlineCardDefinition;
@@ -0,0 +1,2 @@
1
+ import { InlineExtensionDefinition } from '@atlaskit/adf-schema';
2
+ export declare const inlineExtension: (attrs: InlineExtensionDefinition['attrs']) => () => InlineExtensionDefinition;
@@ -0,0 +1,4 @@
1
+ import { BlockContent, LayoutColumnDefinition } from '@atlaskit/adf-schema';
2
+ export declare const layoutColumn: (attrs: {
3
+ width: number;
4
+ }) => (content: BlockContent[]) => LayoutColumnDefinition;
@@ -0,0 +1,2 @@
1
+ import { LayoutColumnDefinition, LayoutSectionDefinition } from '@atlaskit/adf-schema';
2
+ export declare const layoutSection: () => (content: Array<LayoutColumnDefinition>) => LayoutSectionDefinition;
@@ -0,0 +1,2 @@
1
+ import { ListItemDefinition, ListItemArray } from '@atlaskit/adf-schema';
2
+ export declare const listItem: (content: ListItemArray) => ListItemDefinition;
@@ -0,0 +1,2 @@
1
+ import { MediaGroupDefinition, MediaDefinition } from '@atlaskit/adf-schema';
2
+ export declare const mediaGroup: (...content: Array<MediaDefinition>) => MediaGroupDefinition;
@@ -0,0 +1,2 @@
1
+ import { MediaInlineDefinition, MediaInlineAttributes } from '@atlaskit/adf-schema';
2
+ export declare const mediaInline: (attrs: MediaInlineAttributes) => MediaInlineDefinition;
@@ -0,0 +1,7 @@
1
+ import { MediaSingleDefinition, MediaDefinition, RichMediaAttributes as MediaSingleAttributes, CaptionDefinition } from '@atlaskit/adf-schema';
2
+ export declare const mediaSingle: (attrs: MediaSingleAttributes | undefined) => (content: MediaDefinition | [
3
+ MediaDefinition
4
+ ] | [
5
+ MediaDefinition,
6
+ CaptionDefinition
7
+ ]) => MediaSingleDefinition;
@@ -0,0 +1,2 @@
1
+ import { MediaDefinition, MediaAttributes } from '@atlaskit/adf-schema';
2
+ export declare const media: (attrs: MediaAttributes) => MediaDefinition;
@@ -0,0 +1,2 @@
1
+ import { MentionDefinition, MentionAttributes } from '@atlaskit/adf-schema';
2
+ export declare const mention: (attrs: MentionAttributes) => MentionDefinition;
@@ -0,0 +1,2 @@
1
+ import { NestedExpandDefinition, NestedExpandContent } from '@atlaskit/adf-schema';
2
+ export declare const nestedExpand: (attrs: NestedExpandDefinition['attrs']) => (...content: NestedExpandContent) => NestedExpandDefinition;
@@ -0,0 +1,2 @@
1
+ import { ListItemDefinition, OrderedListDefinition } from '@atlaskit/adf-schema';
2
+ export declare const orderedList: (attrs?: OrderedListDefinition['attrs']) => (...content: Array<ListItemDefinition>) => OrderedListDefinition;
@@ -0,0 +1,2 @@
1
+ import { PanelDefinition, PanelAttributes } from '@atlaskit/adf-schema';
2
+ export declare const panel: (attrs: PanelAttributes) => (...content: PanelDefinition['content']) => PanelDefinition;
@@ -0,0 +1,2 @@
1
+ import { ParagraphDefinition, Inline } from '@atlaskit/adf-schema';
2
+ export declare const paragraph: (...content: Array<Inline | string>) => ParagraphDefinition;
@@ -0,0 +1,2 @@
1
+ import { PlaceholderDefinition } from '@atlaskit/adf-schema';
2
+ export declare const placeholder: (attrs: PlaceholderDefinition['attrs']) => PlaceholderDefinition;
@@ -0,0 +1,2 @@
1
+ import { RuleDefinition } from '@atlaskit/adf-schema';
2
+ export declare const rule: () => RuleDefinition;
@@ -0,0 +1,2 @@
1
+ import { StatusDefinition } from '@atlaskit/adf-schema';
2
+ export declare const status: (attrs?: StatusDefinition['attrs']) => StatusDefinition;
@@ -0,0 +1,2 @@
1
+ import { TableCellDefinition, CellAttributes } from '@atlaskit/adf-schema';
2
+ export declare const tableCell: (attrs?: CellAttributes) => (...content: TableCellDefinition['content']) => TableCellDefinition;
@@ -0,0 +1,2 @@
1
+ import { TableHeaderDefinition, CellAttributes } from '@atlaskit/adf-schema';
2
+ export declare const tableHeader: (attrs?: CellAttributes) => (...content: TableHeaderDefinition['content']) => TableHeaderDefinition;
@@ -0,0 +1,2 @@
1
+ import { TableRowDefinition, TableHeaderDefinition, TableCellDefinition } from '@atlaskit/adf-schema';
2
+ export declare const tableRow: (content: Array<TableHeaderDefinition> | Array<TableCellDefinition>) => TableRowDefinition;
@@ -0,0 +1,2 @@
1
+ import { TableDefinition, TableRowDefinition } from '@atlaskit/adf-schema';
2
+ export declare const table: (...content: Array<TableRowDefinition>) => TableDefinition;
@@ -0,0 +1,2 @@
1
+ import { Inline, TaskItemDefinition } from '@atlaskit/adf-schema';
2
+ export declare const taskItem: (attrs: TaskItemDefinition['attrs']) => (...content: Array<Inline>) => TaskItemDefinition;
@@ -0,0 +1,2 @@
1
+ import { TaskListDefinition, TaskListContent } from '@atlaskit/adf-schema';
2
+ export declare const taskList: (attrs: TaskListDefinition['attrs']) => (...content: TaskListContent) => TaskListDefinition;
@@ -0,0 +1,2 @@
1
+ import { TextDefinition } from '@atlaskit/adf-schema';
2
+ export declare const text: (text: string) => TextDefinition;
@@ -0,0 +1,8 @@
1
+ export type WithMark = {
2
+ type: any;
3
+ marks?: Array<any>;
4
+ [prop: string]: any;
5
+ };
6
+ export type WithAppliedMark<T, M> = T & {
7
+ marks?: Array<M>;
8
+ };
@@ -0,0 +1,4 @@
1
+ import { WithMark } from '../types';
2
+ export declare function applyMark<T>(mark: T & {
3
+ type: string;
4
+ }, maybeNode: WithMark | string): WithMark;
@@ -0,0 +1,3 @@
1
+ import { TextDefinition } from '@atlaskit/adf-schema';
2
+ export declare function createTextNodes<T = any>(nodes: Array<T | string>): Array<T | TextDefinition>;
3
+ export declare function createTextFromString<T = any>(str: T | string): T | TextDefinition;
@@ -0,0 +1,6 @@
1
+ export declare function isDuplicateMark(node: {
2
+ marks?: Array<any>;
3
+ }, type: string): boolean;
4
+ export declare function duplicateMarkError(node: {
5
+ marks?: Array<any>;
6
+ }, type: string): string;
@@ -0,0 +1,64 @@
1
+ export { breakout } from './builders/marks/breakout';
2
+ export { code } from './builders/marks/code';
3
+ export { em } from './builders/marks/em';
4
+ export { link } from './builders/marks/link';
5
+ export { link as a } from './builders/marks/link';
6
+ export { strike } from './builders/marks/strike';
7
+ export { strong } from './builders/marks/strong';
8
+ export { strong as b } from './builders/marks/strong';
9
+ export { subsup } from './builders/marks/subsup';
10
+ export { textColor } from './builders/marks/text-color';
11
+ export { underline } from './builders/marks/underline';
12
+ export { underline as u } from './builders/marks/underline';
13
+ export { alignment } from './builders/marks/alignment';
14
+ export { indentation } from './builders/marks/indentation';
15
+ export { dataConsumer } from './builders/marks/data-consumer';
16
+ export { fragment } from './builders/marks/fragment';
17
+ export { border } from './builders/marks/border';
18
+ export { blockQuote } from './builders/nodes/blockquote';
19
+ export { bodiedExtension } from './builders/nodes/bodied-extension';
20
+ export { blockCard } from './builders/nodes/block-card';
21
+ export { bulletList } from './builders/nodes/bullet-list';
22
+ export { bulletList as ul } from './builders/nodes/bullet-list';
23
+ export { codeBlock } from './builders/nodes/code-block';
24
+ export { date } from './builders/nodes/date';
25
+ export { decisionItem } from './builders/nodes/decision-item';
26
+ export { decisionList } from './builders/nodes/decision-list';
27
+ export { doc } from './builders/nodes/doc';
28
+ export { emoji } from './builders/nodes/emoji';
29
+ export { extension } from './builders/nodes/extension';
30
+ export { expand } from './builders/nodes/expand';
31
+ export { nestedExpand } from './builders/nodes/nested-expand';
32
+ export { hardBreak } from './builders/nodes/hard-break';
33
+ export { hardBreak as br } from './builders/nodes/hard-break';
34
+ export { heading } from './builders/nodes/heading';
35
+ export { inlineExtension } from './builders/nodes/inline-extension';
36
+ export { inlineCard } from './builders/nodes/inline-card';
37
+ export { layoutColumn } from './builders/nodes/layout-column';
38
+ export { layoutSection } from './builders/nodes/layout-section';
39
+ export { listItem } from './builders/nodes/list-item';
40
+ export { listItem as li } from './builders/nodes/list-item';
41
+ export { mediaGroup } from './builders/nodes/media-group';
42
+ export { mediaSingle } from './builders/nodes/media-single';
43
+ export { media } from './builders/nodes/media';
44
+ export { mention } from './builders/nodes/mention';
45
+ export { orderedList } from './builders/nodes/ordered-list';
46
+ export { orderedList as ol } from './builders/nodes/ordered-list';
47
+ export { panel } from './builders/nodes/panel';
48
+ export { paragraph } from './builders/nodes/paragraph';
49
+ export { paragraph as p } from './builders/nodes/paragraph';
50
+ export { placeholder } from './builders/nodes/placeholder';
51
+ export { rule } from './builders/nodes/rule';
52
+ export { rule as hr } from './builders/nodes/rule';
53
+ export { status } from './builders/nodes/status';
54
+ export { tableCell } from './builders/nodes/table-cell';
55
+ export { tableCell as td } from './builders/nodes/table-cell';
56
+ export { tableHeader } from './builders/nodes/table-header';
57
+ export { tableHeader as th } from './builders/nodes/table-header';
58
+ export { tableRow } from './builders/nodes/table-row';
59
+ export { tableRow as tr } from './builders/nodes/table-row';
60
+ export { table } from './builders/nodes/table';
61
+ export { taskItem } from './builders/nodes/task-item';
62
+ export { taskList } from './builders/nodes/task-list';
63
+ export { text } from './builders/nodes/text';
64
+ export { embedCard } from './builders/nodes/embed-card';
@@ -0,0 +1,2 @@
1
+ import { DocNode } from './validator/entry';
2
+ export declare const getEmptyADF: () => DocNode;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ADFEntity, EntityParent } from '../types';
2
+ import { ValueReplacements } from './default-value-replacements';
3
+ export type NodeReplacer = (node: ADFEntity, context: {
4
+ parent: EntityParent;
5
+ valueReplacements: ValueReplacements;
6
+ }) => ADFEntity | null | false;
7
+ export type NodeReplacements = {
8
+ [key: string]: NodeReplacer;
9
+ };
10
+ export declare const defaultNodeReplacements: NodeReplacements;
@@ -0,0 +1,6 @@
1
+ export type Value = string | number | boolean | undefined | null;
2
+ export type ValueReplacer<V extends Value> = (value: V) => V;
3
+ export type ValueReplacements = {
4
+ href: ValueReplacer<string>;
5
+ };
6
+ export declare const defaultValueReplacements: ValueReplacements;
@@ -0,0 +1 @@
1
+ export declare const hash: (input: string) => string;
@@ -0,0 +1,9 @@
1
+ import { ADFEntity } from '../types';
2
+ import { NodeReplacements } from './default-node-replacements';
3
+ import { ValueReplacements } from './default-value-replacements';
4
+ export interface ScrubAdfOptions {
5
+ nodeReplacements?: NodeReplacements;
6
+ valueReplacements?: ValueReplacements;
7
+ }
8
+ declare const _default: (adf: ADFEntity, options?: ScrubAdfOptions) => false | ADFEntity;
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { ValueReplacements } from './default-value-replacements';
2
+ export declare const scrubStr: (val: string, offset?: number) => string;
3
+ export type ScrubLinkOptions = {
4
+ valueReplacements: ValueReplacements;
5
+ };
6
+ export declare const scrubLink: (marks: {
7
+ [key: string]: any;
8
+ }[], { valueReplacements }: ScrubLinkOptions) => {
9
+ [key: string]: any;
10
+ }[];
11
+ export declare const scrubAttrs: (nodeType: string, attrs: unknown, offset?: number) => any;
@@ -0,0 +1 @@
1
+ export { default as scrubAdf } from './scrub/scrub-adf';
@@ -0,0 +1,8 @@
1
+ import { ADFEntity, ADFEntityMark } from '../types';
2
+ interface TransformDedupeMarksResult {
3
+ transformedAdf: ADFEntity;
4
+ isTransformed: boolean;
5
+ discardedMarks: ADFEntityMark[];
6
+ }
7
+ export declare const transformDedupeMarks: (adf: ADFEntity) => TransformDedupeMarksResult;
8
+ export {};