@po-ui/ng-components 22.0.0-rc.0 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +1 -1
  2. package/fesm2022/{po-ui-ng-components-po-chart-modal-table.component-B6drxxln.mjs → po-ui-ng-components-po-chart-modal-table.component-Cozxgj7w.mjs} +4 -4
  3. package/fesm2022/{po-ui-ng-components-po-chart-modal-table.component-B6drxxln.mjs.map → po-ui-ng-components-po-chart-modal-table.component-Cozxgj7w.mjs.map} +1 -1
  4. package/fesm2022/po-ui-ng-components.mjs +3072 -1450
  5. package/fesm2022/po-ui-ng-components.mjs.map +1 -1
  6. package/lib/components/po-accordion/po-accordion-item/po-accordion-item.component.d.ts +2 -0
  7. package/lib/components/po-accordion/po-accordion.component.d.ts +2 -0
  8. package/lib/components/po-avatar/po-avatar.component.d.ts +2 -0
  9. package/lib/components/po-badge/po-badge.component.d.ts +2 -0
  10. package/lib/components/po-breadcrumb/po-breadcrumb.component.d.ts +2 -0
  11. package/lib/components/po-button/enums/po-button-kind.enum.d.ts +7 -1
  12. package/lib/components/po-button/po-button-base.component.d.ts +27 -3
  13. package/lib/components/po-button/po-button.component.d.ts +4 -0
  14. package/lib/components/po-button-group/po-button-group.component.d.ts +2 -0
  15. package/lib/components/po-calendar/po-calendar-base.component.d.ts +5 -0
  16. package/lib/components/po-calendar/po-calendar-header/po-calendar-header.component.d.ts +2 -0
  17. package/lib/components/po-calendar/po-calendar-wrapper/po-calendar-wrapper.component.d.ts +12 -0
  18. package/lib/components/po-calendar/po-calendar.component.d.ts +13 -0
  19. package/lib/components/po-chart/interfaces/po-chart-serie.interface.d.ts +29 -2
  20. package/lib/components/po-chart/po-chart.component.d.ts +2 -0
  21. package/lib/components/po-container/po-container.component.d.ts +2 -0
  22. package/lib/components/po-context-menu/po-context-menu.component.d.ts +2 -0
  23. package/lib/components/po-context-tabs/po-context-tabs.component.d.ts +2 -0
  24. package/lib/components/po-disclaimer-group/po-disclaimer-group.component.d.ts +1 -0
  25. package/lib/components/po-divider/po-divider.component.d.ts +2 -0
  26. package/lib/components/po-dropdown/po-dropdown.component.d.ts +2 -0
  27. package/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form.component.d.ts +1 -0
  28. package/lib/components/po-dynamic/po-dynamic-view/po-dynamic-view.component.d.ts +2 -0
  29. package/lib/components/po-field/po-checkbox/po-checkbox.component.d.ts +2 -0
  30. package/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.d.ts +2 -0
  31. package/lib/components/po-field/po-combo/po-combo-option-template/po-combo-option-template.directive.d.ts +2 -0
  32. package/lib/components/po-field/po-combo/po-combo.component.d.ts +2 -0
  33. package/lib/components/po-field/po-datepicker/po-datepicker-base.component.d.ts +15 -4
  34. package/lib/components/po-field/po-datepicker/po-datepicker.component.d.ts +7 -0
  35. package/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.d.ts +3 -0
  36. package/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.d.ts +4 -0
  37. package/lib/components/po-field/po-datetimepicker/po-datetimepicker-base.component.d.ts +5 -0
  38. package/lib/components/po-field/po-datetimepicker/po-datetimepicker.component.d.ts +7 -0
  39. package/lib/components/po-field/po-decimal/po-decimal.component.d.ts +2 -0
  40. package/lib/components/po-field/po-email/po-email.component.d.ts +2 -0
  41. package/lib/components/po-field/po-field-validate.model.d.ts +2 -0
  42. package/lib/components/po-field/po-input/po-input.component.d.ts +2 -0
  43. package/lib/components/po-field/po-login/po-login.component.d.ts +1 -0
  44. package/lib/components/po-field/po-lookup/po-lookup.component.d.ts +2 -0
  45. package/lib/components/po-field/po-multiselect/po-multiselect-option-template/po-multiselect-option-template.directive.d.ts +1 -0
  46. package/lib/components/po-field/po-multiselect/po-multiselect.component.d.ts +1 -0
  47. package/lib/components/po-field/po-number/po-number.component.d.ts +2 -0
  48. package/lib/components/po-field/po-password/po-password.component.d.ts +2 -0
  49. package/lib/components/po-field/po-radio-group/po-radio-group.component.d.ts +1 -0
  50. package/lib/components/po-field/po-rich-text/po-rich-text.component.d.ts +2 -0
  51. package/lib/components/po-field/po-search-ai/po-search-ai.component.d.ts +2 -0
  52. package/lib/components/po-field/po-select/po-select.component.d.ts +1 -0
  53. package/lib/components/po-field/po-switch/po-switch.component.d.ts +2 -0
  54. package/lib/components/po-field/po-textarea/po-textarea.component.d.ts +1 -0
  55. package/lib/components/po-field/po-timepicker/po-timepicker.component.d.ts +2 -0
  56. package/lib/components/po-field/po-upload/po-upload.component.d.ts +2 -0
  57. package/lib/components/po-field/po-url/po-url.component.d.ts +1 -0
  58. package/lib/components/po-filter-chip/po-filter-chip.component.d.ts +2 -0
  59. package/lib/components/po-grid/po-grid.component.d.ts +2 -0
  60. package/lib/components/po-header/po-header.component.d.ts +1 -0
  61. package/lib/components/po-helper/po-helper.component.d.ts +1 -0
  62. package/lib/components/po-image/po-image.component.d.ts +1 -0
  63. package/lib/components/po-info/po-info.component.d.ts +2 -0
  64. package/lib/components/po-link/po-link.component.d.ts +2 -0
  65. package/lib/components/po-list-view/po-list-view-content-template/po-list-view-content-template.directive.d.ts +2 -0
  66. package/lib/components/po-list-view/po-list-view-detail-template/po-list-view-detail-template.directive.d.ts +2 -0
  67. package/lib/components/po-list-view/po-list-view.component.d.ts +2 -0
  68. package/lib/components/po-listbox/po-item-list/po-item-list.component.d.ts +1 -0
  69. package/lib/components/po-listbox/po-listbox.component.d.ts +1 -0
  70. package/lib/components/po-loading/po-loading-overlay/po-loading-overlay.component.d.ts +2 -0
  71. package/lib/components/po-menu/po-menu-header-template/po-menu-header-template.directive.d.ts +2 -0
  72. package/lib/components/po-menu/po-menu.component.d.ts +2 -0
  73. package/lib/components/po-menu-panel/po-menu-panel.component.d.ts +2 -0
  74. package/lib/components/po-modal/po-modal-footer/po-modal-footer.component.d.ts +2 -0
  75. package/lib/components/po-modal/po-modal.component.d.ts +2 -0
  76. package/lib/components/po-navbar/po-navbar.component.d.ts +2 -0
  77. package/lib/components/po-page/po-page-default/po-page-default.component.d.ts +2 -0
  78. package/lib/components/po-page/po-page-detail/po-page-detail.component.d.ts +2 -0
  79. package/lib/components/po-page/po-page-edit/po-page-edit.component.d.ts +2 -0
  80. package/lib/components/po-page/po-page-list/po-page-list.component.d.ts +2 -0
  81. package/lib/components/po-page/po-page-slide/po-page-slide-footer/po-page-slide-footer.component.d.ts +2 -0
  82. package/lib/components/po-page/po-page-slide/po-page-slide.component.d.ts +2 -0
  83. package/lib/components/po-popover/po-popover.component.d.ts +2 -0
  84. package/lib/components/po-popup/po-popup.component.d.ts +1 -0
  85. package/lib/components/po-progress/po-progress.component.d.ts +1 -0
  86. package/lib/components/po-search/po-search.component.d.ts +1 -0
  87. package/lib/components/po-skeleton/po-skeleton.component.d.ts +2 -0
  88. package/lib/components/po-slide/directives/po-slide-content-template.directive.d.ts +2 -0
  89. package/lib/components/po-slide/po-slide.component.d.ts +2 -0
  90. package/lib/components/po-stepper/po-step/po-step.component.d.ts +2 -0
  91. package/lib/components/po-stepper/po-stepper.component.d.ts +2 -0
  92. package/lib/components/po-table/po-table-cell-template/po-table-cell-template.directive.d.ts +2 -0
  93. package/lib/components/po-table/po-table-column-template/po-table-column-template.directive.d.ts +2 -0
  94. package/lib/components/po-table/po-table-row-template/po-table-row-template.directive.d.ts +2 -0
  95. package/lib/components/po-table/po-table.component.d.ts +2 -0
  96. package/lib/components/po-tabs/po-tab/po-tab.component.d.ts +2 -0
  97. package/lib/components/po-tabs/po-tabs.component.d.ts +3 -0
  98. package/lib/components/po-tag/po-tag.component.d.ts +2 -0
  99. package/lib/components/po-toaster/po-toaster.component.d.ts +2 -0
  100. package/lib/components/po-toolbar/po-toolbar.component.d.ts +2 -0
  101. package/lib/components/po-tree-view/po-tree-view.component.d.ts +2 -0
  102. package/lib/components/po-widget/po-widget.component.d.ts +1 -0
  103. package/lib/directives/po-drag-drop/po-drag.directive.d.ts +2 -0
  104. package/lib/directives/po-drag-drop/po-drop-list.directive.d.ts +3 -0
  105. package/lib/directives/po-tooltip/po-tooltip.directive.d.ts +2 -0
  106. package/lib/interceptors/po-http-interceptor/po-http-interceptor.service.d.ts +2 -0
  107. package/lib/interceptors/po-http-request/po-http-request-interceptor.service.d.ts +2 -0
  108. package/lib/po.module.d.ts +2 -0
  109. package/lib/services/po-dialog/po-dialog.service.d.ts +4 -0
  110. package/lib/services/po-i18n/po-i18n.service.d.ts +2 -0
  111. package/lib/services/po-media-query/po-media-query.service.d.ts +1 -0
  112. package/lib/services/po-notification/po-notification.service.d.ts +3 -0
  113. package/lib/services/po-theme/helpers/accessibilities/po-theme-default-aaa.constant.d.ts +1 -8
  114. package/lib/services/po-theme/helpers/deprecated/accessibilities/po-theme-default-aa.constant.d.ts +20 -0
  115. package/lib/services/po-theme/helpers/deprecated/accessibilities/po-theme-default-aaa.constant.d.ts +18 -0
  116. package/lib/services/po-theme/helpers/deprecated/accessibilities/po-theme-density.constant.d.ts +12 -0
  117. package/lib/services/po-theme/helpers/deprecated/po-theme-poui.constant.d.ts +27 -0
  118. package/lib/services/po-theme/helpers/deprecated/types/po-theme-dark-defaults-AA.constant.d.ts +129 -0
  119. package/lib/services/po-theme/helpers/deprecated/types/po-theme-dark-defaults.constant.d.ts +167 -0
  120. package/lib/services/po-theme/helpers/deprecated/types/po-theme-light-defaults-AA.constant.d.ts +49 -0
  121. package/lib/services/po-theme/helpers/deprecated/types/po-theme-light-defaults.constant.d.ts +81 -0
  122. package/lib/services/po-theme/helpers/shared/base.constant.d.ts +146 -0
  123. package/lib/services/po-theme/helpers/types/po-theme-dark-defaults-AA.constant.d.ts +3 -4
  124. package/lib/services/po-theme/helpers/types/po-theme-dark-defaults.constant.d.ts +4 -4
  125. package/lib/services/po-theme/index.d.ts +8 -0
  126. package/lib/services/po-theme/interfaces/po-theme.interface.d.ts +15 -0
  127. package/lib/services/po-theme/po-theme.service.d.ts +64 -0
  128. package/lib/services/po-user-guide/po-user-guide.service.d.ts +2 -0
  129. package/lib/utils/po-picker-mouse-down-guard.d.ts +27 -0
  130. package/lib/utils/util.d.ts +16 -0
  131. package/package.json +4 -4
  132. package/po-ui-ng-components-22.0.0.tgz +0 -0
  133. package/schematics/ng-add/index.js +1 -1
  134. package/schematics/ng-add/setup-project.d.ts +2 -2
  135. package/schematics/ng-update/v14/index.js +1 -1
  136. package/schematics/ng-update/v15/index.js +1 -1
  137. package/schematics/ng-update/v16/index.js +1 -1
  138. package/schematics/ng-update/v17/index.js +1 -1
  139. package/schematics/ng-update/v18/index.d.ts +2 -2
  140. package/schematics/ng-update/v18/index.js +2 -2
  141. package/schematics/ng-update/v19/index.d.ts +2 -2
  142. package/schematics/ng-update/v19/index.js +2 -2
  143. package/schematics/ng-update/v2/index.js +1 -1
  144. package/schematics/ng-update/v20/index.d.ts +2 -2
  145. package/schematics/ng-update/v20/index.js +2 -2
  146. package/schematics/ng-update/v21/index.js +1 -1
  147. package/schematics/ng-update/v22/index.d.ts +20 -4
  148. package/schematics/ng-update/v22/index.js +37 -11
  149. package/schematics/ng-update/v22/index.js.map +1 -1
  150. package/schematics/ng-update/v22/migration-report.d.ts +36 -10
  151. package/schematics/ng-update/v22/migration-report.js +25 -11
  152. package/schematics/ng-update/v22/migration-report.js.map +1 -1
  153. package/schematics/ng-update/v22/theme-deprecated/changes.d.ts +24 -0
  154. package/schematics/ng-update/v22/theme-deprecated/changes.js +58 -0
  155. package/schematics/ng-update/v22/theme-deprecated/changes.js.map +1 -0
  156. package/schematics/ng-update/v22/theme-deprecated/index.d.ts +14 -0
  157. package/schematics/ng-update/v22/theme-deprecated/index.js +291 -0
  158. package/schematics/ng-update/v22/theme-deprecated/index.js.map +1 -0
  159. package/schematics/ng-update/v22/theme-deprecated/prompt.d.ts +49 -0
  160. package/schematics/ng-update/v22/theme-deprecated/prompt.js +59 -0
  161. package/schematics/ng-update/v22/theme-deprecated/prompt.js.map +1 -0
  162. package/schematics/ng-update/v22/theme-deprecated/theme-bootstrap-migration.d.ts +25 -0
  163. package/schematics/ng-update/v22/theme-deprecated/theme-bootstrap-migration.js +198 -0
  164. package/schematics/ng-update/v22/theme-deprecated/theme-bootstrap-migration.js.map +1 -0
  165. package/schematics/ng-update/v22/theme-deprecated/theme-style-migration.d.ts +23 -0
  166. package/schematics/ng-update/v22/theme-deprecated/theme-style-migration.js +64 -0
  167. package/schematics/ng-update/v22/theme-deprecated/theme-style-migration.js.map +1 -0
  168. package/schematics/ng-update/v22/theme-deprecated/theme-ts-migration.d.ts +29 -0
  169. package/schematics/ng-update/v22/theme-deprecated/theme-ts-migration.js +325 -0
  170. package/schematics/ng-update/v22/theme-deprecated/theme-ts-migration.js.map +1 -0
  171. package/schematics/ng-update/v22/theme-deprecated/ts-utils.d.ts +58 -0
  172. package/schematics/ng-update/v22/theme-deprecated/ts-utils.js +112 -0
  173. package/schematics/ng-update/v22/theme-deprecated/ts-utils.js.map +1 -0
  174. package/schematics/ng-update/v3/index.js +1 -1
  175. package/schematics/ng-update/v4/index.js +1 -1
  176. package/schematics/ng-update/v5/index.js +1 -1
  177. package/schematics/ng-update/v6/index.js +1 -1
  178. package/types/po-ui-ng-components.d.ts +18115 -17107
  179. package/po-ui-ng-components-22.0.0-rc.0.tgz +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-bootstrap-migration.js","sourceRoot":"","sources":["../../../../../../projects/ui/schematics/ng-update/v22/theme-deprecated/theme-bootstrap-migration.ts"],"names":[],"mappings":";;;AA2CA,sDA6DC;;AAxGD,uDAAiC;AAEjC,uCAAyF;AACzF,yCAUoB;AAEpB,MAAM,YAAY,GAAG,eAAe,CAAC;AACrC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,iFAAiF;AACpE,QAAA,wBAAwB,GACnC,2GAA2G,CAAC;AAE9G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,qBAAqB,CAAC,MAAc,EAAE,SAAkB;;IACtE,MAAM,UAAU,GAAG,IAAA,sBAAW,EAAC,MAAM,CAAC,CAAC;IACvC,M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C;AAED,SAAS,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACvD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,UAAU,CAAC,UAAyB,EAAE,IAAa;IAC1D,OAAO,UAAU,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,IAAI,CAAC,MAAc,EAAE,IAAY,EAAE,MAAc;IACxD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ThemeMigrationResult } from './ts-utils';
2
+ /** Resultado da troca de arquivos CSS: acrescenta a quantidade de referências trocadas. */
3
+ export interface StyleMigrationResult extends ThemeMigrationResult {
4
+ /** Quantidade de referências trocadas. */
5
+ replacements: number;
6
+ }
7
+ /**
8
+ * Troca, no conteúdo do `angular.json`, as referências aos arquivos CSS do tema
9
+ * padrão do `@po-ui/style` pelas versões do tema anterior.
10
+ *
11
+ * A troca é textual e alcança qualquer string do arquivo, o que cobre todos os
12
+ * projetos, todos os targets e suas `configurations`, entradas em string ou em
13
+ * objeto (`{ "input": ... }`), com e sem o prefixo `./`. A formatação e os
14
+ * comentários do arquivo são preservados. Caminhos que já apontam para
15
+ * `-deprecated` não são alterados.
16
+ */
17
+ export declare function migrateAngularJsonStyles(json: string): StyleMigrationResult;
18
+ /**
19
+ * Troca, num arquivo `.css`/`.scss`/`.sass`/`.less`, as referências de
20
+ * `@import`, `@use` e `@forward` (com ou sem `~`, `url()` e extensão) aos
21
+ * arquivos CSS do tema padrão do `@po-ui/style` pelas versões do tema anterior.
22
+ */
23
+ export declare function migrateStylesheetContent(source: string): StyleMigrationResult;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateAngularJsonStyles = migrateAngularJsonStyles;
4
+ exports.migrateStylesheetContent = migrateStylesheetContent;
5
+ const changes_1 = require("./changes");
6
+ /**
7
+ * Nomes de arquivo sem a extensão `.css` (o Sass aceita `@use`/`@import` sem
8
+ * extensão), ordenados do mais longo para o mais curto para que a alternância
9
+ * da expressão regular não pare num prefixo.
10
+ */
11
+ const styleBaseNames = Object.keys(changes_1.themeDeprecatedStyleMap)
12
+ .map(file => file.replace(/\.css$/, ''))
13
+ .sort((a, b) => b.length - a.length);
14
+ const escape = (value) => value.replace(/[.*+?^${}()|[\]\\/-]/g, '\\$&');
15
+ /**
16
+ * Captura `@po-ui/style/css/<arquivo>[.css]`, exigindo que o nome termine num
17
+ * delimitador. Assim `po-theme-default.min.css` não casa dentro de
18
+ * `po-theme-default-deprecated.min.css` (idempotência).
19
+ */
20
+ const styleReference = new RegExp(`(${escape(`${changes_1.PO_UI_STYLE_PACKAGE}/css/`)})(${styleBaseNames.map(escape).join('|')})(\\.css)?(?=["'\`)\\s;,]|$)`, 'g');
21
+ /** Linhas de stylesheet que referenciam outros arquivos. */
22
+ const stylesheetImportLine = /^\s*@(import|use|forward)\b/;
23
+ /**
24
+ * Troca, no conteúdo do `angular.json`, as referências aos arquivos CSS do tema
25
+ * padrão do `@po-ui/style` pelas versões do tema anterior.
26
+ *
27
+ * A troca é textual e alcança qualquer string do arquivo, o que cobre todos os
28
+ * projetos, todos os targets e suas `configurations`, entradas em string ou em
29
+ * objeto (`{ "input": ... }`), com e sem o prefixo `./`. A formatação e os
30
+ * comentários do arquivo são preservados. Caminhos que já apontam para
31
+ * `-deprecated` não são alterados.
32
+ */
33
+ function migrateAngularJsonStyles(json) {
34
+ return replaceStyleReferences(json, () => true);
35
+ }
36
+ /**
37
+ * Troca, num arquivo `.css`/`.scss`/`.sass`/`.less`, as referências de
38
+ * `@import`, `@use` e `@forward` (com ou sem `~`, `url()` e extensão) aos
39
+ * arquivos CSS do tema padrão do `@po-ui/style` pelas versões do tema anterior.
40
+ */
41
+ function migrateStylesheetContent(source) {
42
+ return replaceStyleReferences(source, line => stylesheetImportLine.test(line));
43
+ }
44
+ function replaceStyleReferences(source, acceptLine) {
45
+ if (!source.includes(`${changes_1.PO_UI_STYLE_PACKAGE}/css/`)) {
46
+ return { content: source, changed: false, warnings: [], replacements: 0 };
47
+ }
48
+ let replacements = 0;
49
+ const content = source
50
+ .split('\n')
51
+ .map(line => {
52
+ if (!acceptLine(line)) {
53
+ return line;
54
+ }
55
+ return line.replace(styleReference, (_match, prefix, baseName, extension = '') => {
56
+ replacements++;
57
+ const deprecated = changes_1.themeDeprecatedStyleMap[`${baseName}.css`].replace(/\.css$/, '');
58
+ return `${prefix}${deprecated}${extension}`;
59
+ });
60
+ })
61
+ .join('\n');
62
+ return { content, changed: content !== source, warnings: [], replacements };
63
+ }
64
+ //# sourceMappingURL=theme-style-migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-style-migration.js","sourceRoot":"","sources":["../../../../../../projects/ui/schematics/ng-update/v22/theme-deprecated/theme-style-migration.ts"],"names":[],"mappings":";;AA2CA,4DAEC;AAOD,4DAEC;AAtDD,uCAAyE;AASzE;;;;GAIG;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,iCAAuB,CAAC;KACxD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;KACvC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,MA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U,GAAG,iCAAuB,CAAC,GAAG,QAAQ,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACpF,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { ThemeMigrationResult } from './ts-utils';
2
+ /**
3
+ * Reaponta, em um arquivo TypeScript, as constantes do tema padrão para as
4
+ * equivalentes do tema anterior (`*Deprecated`).
5
+ *
6
+ * Considera apenas símbolos importados de `@po-ui/ng-components`:
7
+ * - import sem alias: renomeia o import e todas as referências ao símbolo
8
+ * (resolvidas pelo `TypeChecker`, ignorando propriedades e declarações
9
+ * locais com o mesmo nome). Em shorthand, `{ poThemeDefault }` vira
10
+ * `{ poThemeDefault: poThemeDefaultDeprecated }`;
11
+ * - import com alias: troca apenas o nome importado;
12
+ * - import de namespace: `po.poThemeDefault` vira `po.poThemeDefaultDeprecated`;
13
+ * - re-exportação: `export { poThemeDefault } from '@po-ui/ng-components'` vira
14
+ * `export { poThemeDefaultDeprecated as poThemeDefault } ...`, preservando a
15
+ * API pública do arquivo;
16
+ * - não duplica um import depreciado já existente.
17
+ *
18
+ * Quando o arquivo importa o `PoThemeService`, `<expr>.setDefaultTheme(arg)`
19
+ * vira `<expr>.setTheme(poThemeDefaultDeprecated, arg)`, garantindo o import.
20
+ *
21
+ * Gera advertências para `poThemeSharedBase` (sem versão anterior) e para
22
+ * `setDefaultTheme` em arquivos que não importam o `PoThemeService`.
23
+ */
24
+ export declare function migrateThemeTsContent(source: string): ThemeMigrationResult;
25
+ /**
26
+ * Indica se o arquivo importa o `PoThemeService` de `@po-ui/ng-components`
27
+ * (por nome ou por namespace).
28
+ */
29
+ export declare function importsPoThemeService(source: string): boolean;
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateThemeTsContent = migrateThemeTsContent;
4
+ exports.importsPoThemeService = importsPoThemeService;
5
+ const tslib_1 = require("tslib");
6
+ const ts = tslib_1.__importStar(require("typescript"));
7
+ const changes_1 = require("./changes");
8
+ const ts_utils_1 = require("./ts-utils");
9
+ const SET_DEFAULT_THEME = 'setDefaultTheme';
10
+ /**
11
+ * Reaponta, em um arquivo TypeScript, as constantes do tema padrão para as
12
+ * equivalentes do tema anterior (`*Deprecated`).
13
+ *
14
+ * Considera apenas símbolos importados de `@po-ui/ng-components`:
15
+ * - import sem alias: renomeia o import e todas as referências ao símbolo
16
+ * (resolvidas pelo `TypeChecker`, ignorando propriedades e declarações
17
+ * locais com o mesmo nome). Em shorthand, `{ poThemeDefault }` vira
18
+ * `{ poThemeDefault: poThemeDefaultDeprecated }`;
19
+ * - import com alias: troca apenas o nome importado;
20
+ * - import de namespace: `po.poThemeDefault` vira `po.poThemeDefaultDeprecated`;
21
+ * - re-exportação: `export { poThemeDefault } from '@po-ui/ng-components'` vira
22
+ * `export { poThemeDefaultDeprecated as poThemeDefault } ...`, preservando a
23
+ * API pública do arquivo;
24
+ * - não duplica um import depreciado já existente.
25
+ *
26
+ * Quando o arquivo importa o `PoThemeService`, `<expr>.setDefaultTheme(arg)`
27
+ * vira `<expr>.setTheme(poThemeDefaultDeprecated, arg)`, garantindo o import.
28
+ *
29
+ * Gera advertências para `poThemeSharedBase` (sem versão anterior) e para
30
+ * `setDefaultTheme` em arquivos que não importam o `PoThemeService`.
31
+ */
32
+ function migrateThemeTsContent(source) {
33
+ const warnings = [];
34
+ if (!source.includes(changes_1.PO_UI_PACKAGE) && !source.includes(SET_DEFAULT_THEME)) {
35
+ return { content: source, changed: false, warnings };
36
+ }
37
+ const sourceFile = (0, ts_utils_1.parseSource)(source);
38
+ const poImports = (0, ts_utils_1.collectImports)(sourceFile, changes_1.PO_UI_PACKAGE);
39
+ const edits = [];
40
+ const importState = buildImportEdits(sourceFile, poImports, edits, warnings);
41
+ if (importState.renameByImport.size > 0 || importState.namespaces.size > 0) {
42
+ const checker = createChecker(sourceFile);
43
+ buildReferenceEdits(sourceFile, checker, importState, edits, warnings);
44
+ }
45
+ buildReExportEdits(sourceFile, edits);
46
+ buildSetDefaultThemeEdits(sourceFile, poImports, importState, edits, warnings);
47
+ if (edits.length === 0) {
48
+ return { content: source, changed: false, warnings };
49
+ }
50
+ const content = (0, ts_utils_1.applyEdits)(source, edits);
51
+ return { content, changed: content !== source, warnings };
52
+ }
53
+ /**
54
+ * Indica se o arquivo importa o `PoThemeService` de `@po-ui/ng-components`
55
+ * (por nome ou por namespace).
56
+ */
57
+ function importsPoThemeService(source) {
58
+ if (!source.includes(changes_1.PO_UI_PACKAGE) || !source.includes(changes_1.PO_THEME_SERVICE)) {
59
+ return false;
60
+ }
61
+ const sourceFile = (0, ts_utils_1.parseSource)(source);
62
+ return (0, ts_utils_1.collectImports)(sourceFile, changes_1.PO_UI_PACKAGE).some(decl => {
63
+ var _a;
64
+ return ((_a = (0, ts_utils_1.getNamedImports)(decl)) === null || _a === void 0 ? void 0 : _a.elements.some(element => (0, ts_utils_1.importedNameOf)(element) === changes_1.PO_THEME_SERVICE)) ||
65
+ ((0, ts_utils_1.getNamespaceImport)(decl) !== undefined && source.includes(`.${changes_1.PO_THEME_SERVICE}`));
66
+ });
67
+ }
68
+ function buildImportEdits(sourceFile, poImports, edits, warnings) {
69
+ var _a, _b, _c;
70
+ const state = {
71
+ renameByImport: new Map(),
72
+ namespaces: new Set(),
73
+ localNamesAfter: new Set()
74
+ };
75
+ // Nomes que permanecem como estão (não mapeados ou com alias).
76
+ for (const decl of poImports) {
77
+ const namespace = (0, ts_utils_1.getNamespaceImport)(decl);
78
+ if (namespace) {
79
+ state.namespaces.add(namespace.text);
80
+ }
81
+ for (const element of (_b = (_a = (0, ts_utils_1.getNamedImports)(decl)) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : []) {
82
+ const importedName = (0, ts_utils_1.importedNameOf)(element);
83
+ const mapped = hasMapping(importedName);
84
+ if (!mapped || element.propertyName) {
85
+ state.localNamesAfter.add(element.name.text);
86
+ }
87
+ if (importedName === changes_1.PO_THEME_DEFAULT_DEPRECATED) {
88
+ state.deprecatedThemeLocal = element.name.text;
89
+ }
90
+ if (changes_1.themeSymbolsWithoutDeprecated.includes(importedName)) {
91
+ warnings.push(withoutDeprecatedWarning(sourceFile, element, importedName));
92
+ }
93
+ }
94
+ }
95
+ for (const decl of poImports) {
96
+ const named = (0, ts_utils_1.getNamedImports)(decl);
97
+ if (!named) {
98
+ continue;
99
+ }
100
+ const mappedElements = named.elements.filter(element => hasMapping((0, ts_utils_1.importedNameOf)(element)));
101
+ const removed = new Set();
102
+ const elementEdits = [];
103
+ for (const element of mappedElements) {
104
+ const target = changes_1.themeDeprecatedSymbolMap[(0, ts_utils_1.importedNameOf)(element)];
105
+ if (element.propertyName) {
106
+ // `poThemeDefault as x` -> `poThemeDefaultDeprecated as x`
107
+ elementEdits.push(replaceNodeEdit(sourceFile, element.propertyName, target));
108
+ if (target === changes_1.PO_THEME_DEFAULT_DEPRECATED) {
109
+ state.deprecatedThemeLocal = element.name.text;
110
+ }
111
+ continue;
112
+ }
113
+ state.renameByImport.set(element.name, target);
114
+ if (state.localNamesAfter.has(target)) {
115
+ removed.add(element);
116
+ }
117
+ else {
118
+ elementEdits.push(replaceNodeEdit(sourceFile, element.name, target));
119
+ state.localNamesAfter.add(target);
120
+ if (target === changes_1.PO_THEME_DEFAULT_DEPRECATED) {
121
+ state.deprecatedThemeLocal = target;
122
+ }
123
+ }
124
+ }
125
+ const allRemoved = removed.size > 0 && named.elements.every(element => removed.has(element));
126
+ if (allRemoved && !((_c = decl.importClause) === null || _c === void 0 ? void 0 : _c.name)) {
127
+ edits.push((0, ts_utils_1.removeDeclarationEdit)(sourceFile, decl));
128
+ continue;
129
+ }
130
+ removed.forEach(element => {
131
+ if (allRemoved) {
132
+ // Import com default + nomeados: mantém o especificador como alias.
133
+ const target = changes_1.themeDeprecatedSymbolMap[(0, ts_utils_1.importedNameOf)(element)];
134
+ elementEdits.push(replaceNodeEdit(sourceFile, element.name, `${target} as ${element.name.text}`));
135
+ state.renameByImport.delete(element.name);
136
+ }
137
+ else {
138
+ elementEdits.push((0, ts_utils_1.removeSpecifierEdit)(sourceFile, named, element));
139
+ }
140
+ });
141
+ edits.push(...elementEdits);
142
+ }
143
+ return state;
144
+ }
145
+ function buildReferenceEdits(sourceFile, checker, state, edits, warnings) {
146
+ const targetBySymbol = new Map();
147
+ state.renameByImport.forEach((target, identifier) => {
148
+ const symbol = checker.getSymbolAtLocation(identifier);
149
+ if (symbol) {
150
+ targetBySymbol.set(symbol, target);
151
+ }
152
+ });
153
+ const visit = (node) => {
154
+ if (ts.isImportDeclaration(node) || (ts.isExportDeclaration(node) && node.moduleSpecifier)) {
155
+ return;
156
+ }
157
+ if ((ts.isPropertyAccessExpression(node) || ts.isQualifiedName(node)) &&
158
+ handleNamespaceAccess(sourceFile, node, state, edits, warnings)) {
159
+ return;
160
+ }
161
+ if (ts.isIdentifier(node) && targetBySymbol.size > 0) {
162
+ const edit = referenceEdit(sourceFile, checker, node, targetBySymbol);
163
+ if (edit) {
164
+ edits.push(edit);
165
+ }
166
+ return;
167
+ }
168
+ ts.forEachChild(node, visit);
169
+ };
170
+ visit(sourceFile);
171
+ }
172
+ /** `po.poThemeDefault` / `typeof po.poThemeDefault` -> `po.poThemeDefaultDeprecated`. */
173
+ function handleNamespaceAccess(sourceFile, node, state, edits, warnings) {
174
+ const left = ts.isPropertyAccessExpression(node) ? node.expression : node.left;
175
+ const right = ts.isPropertyAccessExpression(node) ? node.name : node.right;
176
+ if (!ts.isIdentifier(left) || !state.namespaces.has(left.text) || !ts.isIdentifier(right)) {
177
+ return false;
178
+ }
179
+ if (hasMapping(right.text)) {
180
+ edits.push(replaceNodeEdit(sourceFile, right, changes_1.themeDeprecatedSymbolMap[right.text]));
181
+ return true;
182
+ }
183
+ if (changes_1.themeSymbolsWithoutDeprecated.includes(right.text)) {
184
+ warnings.push(withoutDeprecatedWarning(sourceFile, right, right.text));
185
+ return true;
186
+ }
187
+ return false;
188
+ }
189
+ /** Edição de uma referência a símbolo importado sem alias. */
190
+ function referenceEdit(sourceFile, checker, node, targetBySymbol) {
191
+ const parent = node.parent;
192
+ // `{ poThemeDefault }` -> `{ poThemeDefault: poThemeDefaultDeprecated }`
193
+ if (parent && ts.isShorthandPropertyAssignment(parent) && parent.name === node) {
194
+ const symbol = checker.getShorthandAssignmentValueSymbol(parent);
195
+ const target = symbol && targetBySymbol.get(symbol);
196
+ return target ? replaceNodeEdit(sourceFile, node, `${node.text}: ${target}`) : undefined;
197
+ }
198
+ // `export { poThemeDefault }` -> `export { poThemeDefaultDeprecated as poThemeDefault }`
199
+ if (parent && ts.isExportSpecifier(parent)) {
200
+ const isLocalName = parent.propertyName ? parent.propertyName === node : parent.name === node;
201
+ const symbol = isLocalName ? checker.getExportSpecifierLocalTargetSymbol(parent) : undefined;
202
+ const target = symbol && targetBySymbol.get(symbol);
203
+ if (!target) {
204
+ return undefined;
205
+ }
206
+ return parent.propertyName
207
+ ? replaceNodeEdit(sourceFile, node, target)
208
+ : replaceNodeEdit(sourceFile, node, `${target} as ${node.text}`);
209
+ }
210
+ const symbol = checker.getSymbolAtLocation(node);
211
+ const target = symbol && targetBySymbol.get(symbol);
212
+ return target ? replaceNodeEdit(sourceFile, node, target) : undefined;
213
+ }
214
+ /** `export { poThemeDefault } from '@po-ui/ng-components'`. */
215
+ function buildReExportEdits(sourceFile, edits) {
216
+ for (const statement of sourceFile.statements) {
217
+ if (!ts.isExportDeclaration(statement) ||
218
+ !statement.moduleSpecifier ||
219
+ !ts.isStringLiteral(statement.moduleSpecifier) ||
220
+ statement.moduleSpecifier.text !== changes_1.PO_UI_PACKAGE ||
221
+ !statement.exportClause ||
222
+ !ts.isNamedExports(statement.exportClause)) {
223
+ continue;
224
+ }
225
+ for (const element of statement.exportClause.elements) {
226
+ const importedName = (0, ts_utils_1.importedNameOf)(element);
227
+ if (!hasMapping(importedName)) {
228
+ continue;
229
+ }
230
+ const target = changes_1.themeDeprecatedSymbolMap[importedName];
231
+ edits.push(element.propertyName
232
+ ? replaceNodeEdit(sourceFile, element.propertyName, target)
233
+ : replaceNodeEdit(sourceFile, element.name, `${target} as ${element.name.text}`));
234
+ }
235
+ }
236
+ }
237
+ /** `<expr>.setDefaultTheme(arg)` -> `<expr>.setTheme(poThemeDefaultDeprecated, arg)`. */
238
+ function buildSetDefaultThemeEdits(sourceFile, poImports, state, edits, warnings) {
239
+ const calls = [];
240
+ const collect = (node) => {
241
+ if (ts.isCallExpression(node) &&
242
+ ts.isPropertyAccessExpression(node.expression) &&
243
+ node.expression.name.text === SET_DEFAULT_THEME) {
244
+ calls.push(node);
245
+ }
246
+ ts.forEachChild(node, collect);
247
+ };
248
+ collect(sourceFile);
249
+ if (calls.length === 0) {
250
+ return;
251
+ }
252
+ const serviceImports = poImports
253
+ .map(ts_utils_1.getNamedImports)
254
+ .find(named => named === null || named === void 0 ? void 0 : named.elements.some(element => (0, ts_utils_1.importedNameOf)(element) === changes_1.PO_THEME_SERVICE));
255
+ const namespace = state.namespaces.values().next().value;
256
+ if (!serviceImports && !namespace) {
257
+ calls.forEach(call => warnings.push({
258
+ filePath: '',
259
+ line: (0, ts_utils_1.lineOf)(sourceFile, call),
260
+ reason: `A chamada "${SET_DEFAULT_THEME}" não foi migrada porque o arquivo não importa o ` +
261
+ `"${changes_1.PO_THEME_SERVICE}" de "${changes_1.PO_UI_PACKAGE}". Se ela pertence ao serviço de tema, troque por ` +
262
+ `"setTheme(${changes_1.PO_THEME_DEFAULT_DEPRECATED}, <tipo>)".`
263
+ }));
264
+ return;
265
+ }
266
+ let reference = state.deprecatedThemeLocal;
267
+ if (!reference && serviceImports) {
268
+ edits.push((0, ts_utils_1.appendSpecifiersEdit)(serviceImports, [changes_1.PO_THEME_DEFAULT_DEPRECATED]));
269
+ reference = changes_1.PO_THEME_DEFAULT_DEPRECATED;
270
+ }
271
+ else if (!reference) {
272
+ reference = `${namespace}.${changes_1.PO_THEME_DEFAULT_DEPRECATED}`;
273
+ }
274
+ for (const call of calls) {
275
+ const access = call.expression;
276
+ edits.push(replaceNodeEdit(sourceFile, access.name, 'setTheme'));
277
+ if (call.arguments.length > 0) {
278
+ const start = call.arguments[0].getStart(sourceFile);
279
+ edits.push({ start, end: start, text: `${reference}, ` });
280
+ }
281
+ else {
282
+ edits.push({ start: call.arguments.pos, end: call.arguments.pos, text: reference });
283
+ }
284
+ }
285
+ }
286
+ function hasMapping(name) {
287
+ return Object.prototype.hasOwnProperty.call(changes_1.themeDeprecatedSymbolMap, name);
288
+ }
289
+ function replaceNodeEdit(sourceFile, node, text) {
290
+ return { start: node.getStart(sourceFile), end: node.getEnd(), text };
291
+ }
292
+ function withoutDeprecatedWarning(sourceFile, node, name) {
293
+ return {
294
+ filePath: '',
295
+ line: (0, ts_utils_1.lineOf)(sourceFile, node),
296
+ reason: `"${name}" faz parte do novo tema padrão e não possui equivalente no tema anterior. ` +
297
+ `Revise manualmente este uso.`
298
+ };
299
+ }
300
+ /**
301
+ * Cria um `TypeChecker` apenas para o arquivo informado, sem resolver módulos
302
+ * nem carregar a `lib`. Suficiente para ligar cada referência ao símbolo do
303
+ * seu import (inclusive com sombreamento por declarações locais).
304
+ */
305
+ function createChecker(sourceFile) {
306
+ const fileName = sourceFile.fileName;
307
+ const host = {
308
+ getSourceFile: name => (name === fileName ? sourceFile : undefined),
309
+ getDefaultLibFileName: () => 'lib.d.ts',
310
+ writeFile: () => undefined,
311
+ getCurrentDirectory: () => '/',
312
+ getCanonicalFileName: name => name,
313
+ useCaseSensitiveFileNames: () => true,
314
+ getNewLine: () => '\n',
315
+ fileExists: name => name === fileName,
316
+ readFile: () => undefined
317
+ };
318
+ const program = ts.createProgram({
319
+ rootNames: [fileName],
320
+ options: { noLib: true, noResolve: true, types: [], target: ts.ScriptTarget.Latest },
321
+ host
322
+ });
323
+ return program.getTypeChecker();
324
+ }
325
+ //# sourceMappingURL=theme-ts-migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-ts-migration.js","sourceRoot":"","sources":["../../../../../../projects/ui/schematics/ng-update/v22/theme-deprecated/theme-ts-migration.ts"],"names":[],"mappings":";;AAiDA,sDA2BC;AAMD,sDAWC;;AA7FD,uDAAiC;AAEjC,uCAMmB;AACnB,yCAcoB;AAEpB,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,qBAAqB,CAAC,MAAc;IAClD,MAAM,QAAQ,GAAiC,EAAE,CAAC;IAElD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACvD,CAAC;IAED,MAAM,UAAU,GAAG,IAAA,sBAAW,EAAC,MAAM,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,IAAA,yBAAc,EAAC,UAAU,EAAE,uBAAa,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,MAAM,WAAW,GAAG,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE7E,IAAI,WAAW,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC3E,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QAC1C,mBAAmB,CAAC,UAAU,EAAE,OAAO,E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,IAAI;KACL,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,cAAc,EAAE,CAAC;AAClC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import * as ts from 'typescript';
2
+ /** Advertência de um caso que exige revisão manual. */
3
+ export interface ThemeMigrationWarning {
4
+ /** Caminho do arquivo. As funções puras deixam vazio e a regra preenche. */
5
+ filePath: string;
6
+ /** Linha (1-indexada) do trecho. */
7
+ line: number;
8
+ /** Motivo da revisão manual. */
9
+ reason: string;
10
+ }
11
+ /** Resultado das transformações puras (string para string). */
12
+ export interface ThemeMigrationResult {
13
+ /** Conteúdo transformado (idêntico ao original quando nada mudou). */
14
+ content: string;
15
+ /** `true` somente quando alguma transformação foi aplicada. */
16
+ changed: boolean;
17
+ /** Casos que exigem revisão manual. */
18
+ warnings: Array<ThemeMigrationWarning>;
19
+ }
20
+ /** Edição textual pontual sobre o conteúdo original. */
21
+ export interface TextEdit {
22
+ start: number;
23
+ end: number;
24
+ text: string;
25
+ }
26
+ /** Cria a AST de um arquivo com os nós pais preenchidos. */
27
+ export declare function parseSource(source: string, fileName?: string): ts.SourceFile;
28
+ /** Retorna as `ImportDeclaration` do módulo informado. */
29
+ export declare function collectImports(sourceFile: ts.SourceFile, moduleName: string): Array<ts.ImportDeclaration>;
30
+ /** Retorna os `NamedImports` de uma declaração, quando existirem. */
31
+ export declare function getNamedImports(decl: ts.ImportDeclaration): ts.NamedImports | undefined;
32
+ /** Retorna o nome local do namespace (`import * as po`), quando existir. */
33
+ export declare function getNamespaceImport(decl: ts.ImportDeclaration): ts.Identifier | undefined;
34
+ /** Nome importado de um especificador (lado esquerdo do `as`). */
35
+ export declare function importedNameOf(specifier: ts.ImportSpecifier | ts.ExportSpecifier): string;
36
+ /**
37
+ * Localiza o nome local de um símbolo importado do módulo informado.
38
+ * Retorna `undefined` se o símbolo não é importado.
39
+ */
40
+ export declare function findLocalImportName(sourceFile: ts.SourceFile, moduleName: string, importedName: string): string | undefined;
41
+ /** Edição que remove um `ImportSpecifier`, cuidando das vírgulas. */
42
+ export declare function removeSpecifierEdit(sourceFile: ts.SourceFile, named: ts.NamedImports, element: ts.ImportSpecifier): TextEdit;
43
+ /** Edição que remove uma `ImportDeclaration` inteira, incluindo a quebra de linha seguinte. */
44
+ export declare function removeDeclarationEdit(sourceFile: ts.SourceFile, decl: ts.ImportDeclaration): TextEdit;
45
+ /**
46
+ * Edição que acrescenta símbolos a um import nomeado existente, depois do
47
+ * último elemento (preserva vírgula final e quebras de linha).
48
+ */
49
+ export declare function appendSpecifiersEdit(named: ts.NamedImports, names: Array<string>): TextEdit;
50
+ /** Edição que insere novas linhas de import depois do último import do arquivo. */
51
+ export declare function addImportLinesEdit(sourceFile: ts.SourceFile, imports: Array<{
52
+ names: Array<string>;
53
+ moduleName: string;
54
+ }>): TextEdit;
55
+ /** Linha (1-indexada) em que o nó inicia. */
56
+ export declare function lineOf(sourceFile: ts.SourceFile, node: ts.Node): number;
57
+ /** Aplica as edições do fim para o início, preservando os offsets. */
58
+ export declare function applyEdits(source: string, edits: Array<TextEdit>): string;