Skip to content

Commit

Permalink
add auto generated header to type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Nov 20, 2024
1 parent 6f05004 commit b0f9f2c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ace.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* This file is generated using `npm run update-types` */

/// <reference path="./types/ace-lib.d.ts" />
/// <reference path="./types/ace-modules.d.ts" />
/// <reference path="./types/ace-theme.d.ts" />
Expand Down
3 changes: 3 additions & 0 deletions tool/ace_declaration_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const path = require("path");

const SEPARATE_MODULES = ["ext", "theme", "snippets", "lib"]; // adjust this list for more granularity

const AUTO_GENERATED_HEADER = "/* This file is generated using `npm run update-types` */\n\n";

const defaultFormatCodeSettings = {
baseIndentSize: 0,
indentSize: 4,
Expand Down Expand Up @@ -407,6 +409,7 @@ function fixDeclaration(content, aceNamespacePath) {
output = correctImportStatements(output);
output = cleanComments(output);
output = formatDts(outputName, output);
output = AUTO_GENERATED_HEADER + output;
fs.writeFileSync(outputName, output);
});

Expand Down
2 changes: 2 additions & 0 deletions types/ace-ext.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* This file is generated using `npm run update-types` */

declare module "ace-code/src/ext/command_bar" {
/**
* Displays a command tooltip above the currently active line selection, with clickable elements.
Expand Down
2 changes: 2 additions & 0 deletions types/ace-lib.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* This file is generated using `npm run update-types` */

declare module "ace-code/src/lib/useragent" {
export namespace OS {
let LINUX: string;
Expand Down
2 changes: 2 additions & 0 deletions types/ace-modules.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* This file is generated using `npm run update-types` */

declare module "ace-code/src/layer/font_metrics" {
export class FontMetrics {
constructor(parentEl: HTMLElement);
Expand Down
2 changes: 2 additions & 0 deletions types/ace-snippets.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* This file is generated using `npm run update-types` */

declare module "ace-code/src/snippets/abc.snippets" {
const _exports: string;
export = _exports;
Expand Down
2 changes: 2 additions & 0 deletions types/ace-theme.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* This file is generated using `npm run update-types` */

declare module "ace-code/src/theme/textmate-css" {
const _exports: string;
export = _exports;
Expand Down

0 comments on commit b0f9f2c

Please sign in to comment.