Skip to content

Commit 14d30d7

Browse files
committed
refactor: add internal types to exports map
1 parent a635e7b commit 14d30d7

File tree

7 files changed

+27
-5
lines changed

7 files changed

+27
-5
lines changed

packages/base/package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"./dist": "./dist/index.js",
1616
"./dist/*": "./dist/*",
1717
"./dist/*.js": "./dist/*.js",
18-
"./internal/addCustomCSSWithScoping.js": "./dist/utils/addCustomCSSWithScoping.js",
1918
"./Device": {
2019
"types": "./dist/Device/index.d.ts",
2120
"default": "./dist/Device/index.js"
@@ -51,7 +50,16 @@
5150
"./utils": {
5251
"types": "./dist/utils/index.d.ts",
5352
"default": "./dist/utils/index.js"
54-
}
53+
},
54+
"./internal/types": {
55+
"types": "./dist/types/internal/index.d.ts",
56+
"default": "./dist/types/internal/index.js"
57+
},
58+
"./internal/addCustomCSSWithScoping": {
59+
"types": "./dist/utils/addCustomCSSWithScoping.d.ts",
60+
"default": "./dist/utils/addCustomCSSWithScoping.js"
61+
},
62+
"./internal/addCustomCSSWithScoping.js": "./dist/utils/addCustomCSSWithScoping.js"
5563
},
5664
"homepage": "https://sap.github.io/ui5-webcomponents-react",
5765
"repository": {

packages/base/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { WithWebComponentPropTypes } from './wrapper/withWebComponent.js';
1010
export * from './styling/CssSizeVariables.js';
1111
export * from './utils/index.js';
1212
export * from './hooks/index.js';
13-
export type * from './types/index.js';
13+
export type * from './types/internal/index.js';
1414

1515
export { I18nStore, StyleStore, ThemingParameters, Device, hooks, withWebComponent };
1616
export type { WithWebComponentPropTypes };

packages/base/src/types/CommonProps.ts renamed to packages/base/src/types/internal/CommonProps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { CSSProperties, HTMLAttributes } from 'react';
22

3+
/**
4+
* ⚠️ __INTERNAL__ use only! This interface is not part of the public API.
5+
*/
36
export interface CommonProps<T = HTMLElement> extends Omit<HTMLAttributes<T>, 'dangerouslySetInnerHTML'> {
47
/**
58
* Element style which will be appended to the most outer element of a component.

packages/base/src/types/Ui5CustomEvent.ts renamed to packages/base/src/types/internal/Ui5CustomEvent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* ⚠️ __INTERNAL__ use only! This interface is not part of the public API.
3+
*/
14
export interface Ui5CustomEvent<EventTarget = HTMLElement, Detail = never>
25
extends Omit<CustomEvent<Detail>, 'target' | 'currentTarget'> {
36
target: EventTarget;
File renamed without changes.
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import type { ReactElement, ReactNode, ReactPortal } from 'react';
2-
2+
/**
3+
* ⚠️ __INTERNAL__ use only! This type is not part of the public API.
4+
*/
35
export type ReducedReactNode = Exclude<ReactNode, string | number | boolean | ReactPortal | Iterable<ReactNode>>;
6+
/**
7+
* ⚠️ __INTERNAL__ use only! This type is not part of the public API.
8+
*/
49
export type ReducedReactNodeWithBoolean = Exclude<ReactNode, string | number | ReactPortal | Iterable<ReactNode>>;
510

611
type InternalUI5WCSlotsNode =
@@ -9,6 +14,9 @@ type InternalUI5WCSlotsNode =
914
| false
1015
| ReactElement /* necessary for React v16 & v17 ReactNode type*/;
1116

17+
/**
18+
* ⚠️ __INTERNAL__ use only! This type is not part of the public API.
19+
*/
1220
export type UI5WCSlotsNode = InternalUI5WCSlotsNode | InternalUI5WCSlotsNode[];
1321

1422
export type { CommonProps } from './CommonProps.js';

packages/base/src/wrapper/withWebComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ComponentType, ReactElement, ReactNode, Ref } from 'react';
55
import { cloneElement, forwardRef, Fragment, isValidElement, useEffect, useState, version } from 'react';
66
import { useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect.js';
77
import { useSyncRef } from '../hooks/useSyncRef.js';
8-
import type { CommonProps, Ui5DomRef } from '../types/index.js';
8+
import type { CommonProps, Ui5DomRef } from '../types/internal/index.js';
99
import { camelToKebabCase, capitalizeFirstLetter, kebabToCamelCase, parseSemVer } from '../utils/index.js';
1010

1111
const createEventPropName = (eventName: string) => `on${capitalizeFirstLetter(kebabToCamelCase(eventName))}`;

0 commit comments

Comments
 (0)