Browse Source

chore: adds *.d.ts

e22m4u 2 years ago
parent
commit
2f82b086bd
5 changed files with 41 additions and 0 deletions
  1. 1 0
      .eslintignore
  2. 6 0
      src/array-to-list.d.ts
  3. 12 0
      src/errorf.d.ts
  4. 16 0
      src/format.d.ts
  5. 6 0
      src/value-to-string.d.ts

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+*.d.ts

+ 6 - 0
src/array-to-list.d.ts

@@ -0,0 +1,6 @@
+/**
+ * Array to list.
+ *
+ * @param input
+ */
+declare function arrayToList(input: any): string;

+ 12 - 0
src/errorf.d.ts

@@ -0,0 +1,12 @@
+/**
+ * Errorf.
+ */
+declare class Errorf extends Error {
+  /**
+   * Constructor.
+   *
+   * @param pattern
+   * @param args
+   */
+  constructor(pattern: string, ...args: any[]);
+}

+ 16 - 0
src/format.d.ts

@@ -0,0 +1,16 @@
+/**
+ * Format.
+ *
+ * native:
+ * s - string
+ * d - digits
+ * j - json
+ *
+ * extras:
+ * v - value (valueToString.js)
+ * l - list (arrayToList.js)
+ *
+ * @param pattern
+ * @param args
+ */
+declare function format(pattern: string, ...args: any[]): string;

+ 6 - 0
src/value-to-string.d.ts

@@ -0,0 +1,6 @@
+/**
+ * Value to string.
+ *
+ * @param input
+ */
+declare function valueToString(input: any): string;