Skip to content

Commit

Permalink
update exported type
Browse files Browse the repository at this point in the history
  • Loading branch information
rawpixel-vincent committed Mar 31, 2024
1 parent baeb6b7 commit cab0b5f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 24 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "string-literal-list",
"version": "1.23.0",
"version": "1.24.0",
"description": "an array for string literal",
"main": "stringList.cjs",
"module": "stringList.js",
Expand All @@ -25,7 +25,7 @@
"default": "./strict.js"
},
"./types.js": {
"default": "./types/index.js"
"default": "./types/index.d.ts"
},
"./stringList.js": {
"types": "./stringList.d.ts",
Expand Down
5 changes: 2 additions & 3 deletions types/generic.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/// <reference path="./index.d.ts" />
import './index.js';

declare global {
export namespace StringLiteralList {}
export namespace StringLiteralList.generic {
namespace StringLiteralList {}
namespace StringLiteralList.generic {
/**
* Returns a tuple of the given length with the given type.
*/
Expand Down
7 changes: 3 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
import { ArrayInPlaceMutation } from '../StringLiteralList.js';

declare global {
export namespace StringLiteralList {}

export namespace specs {
namespace StringLiteralList {}
namespace StringLiteralList.specs {
/**
* @description
* These methods changes the array in place.
Expand Down Expand Up @@ -79,4 +78,4 @@ declare global {
}
}

export { StringLiteralList as sl };
export {};
6 changes: 6 additions & 0 deletions types/list.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/// <reference path="index.d.ts" />
/// <reference path="generic.d.ts" />
/// <reference path="string.d.ts" />
/// <reference path="tuple.d.ts" />
/// <reference path="record.d.ts" />

declare global {
namespace StringLiteralList {}
namespace StringLiteralList.list {
Expand Down
5 changes: 3 additions & 2 deletions types/record.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference path="index.d.ts" />
declare global {
export namespace StringLiteralList {}
export namespace StringLiteralList.record {
namespace StringLiteralList {}
namespace StringLiteralList.record {
export type StringRecord<T extends string, S extends unknown> = Record<
T,
S
Expand Down
6 changes: 2 additions & 4 deletions types/string.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/// <reference path="generic.d.ts" />
/// <reference path="index.d.ts" />
/// <reference path="tuple.d.ts" />

declare global {
export namespace StringLiteralList {}
export namespace StringLiteralList.string {
namespace StringLiteralList {}
namespace StringLiteralList.string {
/**
* @credit @gustavoguichard
* For the string manipulation types,
Expand Down
9 changes: 2 additions & 7 deletions types/tuple.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
/// <reference path='./string.d.ts' />

declare global {
export namespace StringLiteralList {}
/**
* @name tuple
* @description A tuple is a an immutable list of elements that infer the position and the length of its elements.
* This is useful to create an array that is used as an argument for a function that requires an ordered list of parameters.
*/
export namespace StringLiteralList.tuple {
namespace StringLiteralList {}
namespace StringLiteralList.tuple {
export type GetTuplePositiveIndex<
T extends readonly any[],
I extends number,
Expand Down

0 comments on commit cab0b5f

Please sign in to comment.