Skip to content

Commit

Permalink
feat: 完善ts类型注释
Browse files Browse the repository at this point in the history
  • Loading branch information
IVLIU committed Mar 1, 2024
1 parent 95e64fe commit e374c2b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ const NativeActivity = (
: null
);

/**
*
* @param props IProps
* @description This is a component that keeps its state while hiding it
* @example
* when visible
* <Activity mode="visible">
* <Child />
* </Activity>
* when hidden
* <Activity mode="hidden">
* <Child />
* </Activity>
*/
export const Activity: FC<IProps> = (props) => {
// props
const { mode, children } = props;

if (NativeActivity) {
Expand Down
1 change: 1 addition & 0 deletions src/Repeater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const Repeater: FC<IProps> = (props) => {
}

// warning
// ? throw a new promise is pending
if (mode === "hidden") {
console.error(
navigator.language === "zh-CN"
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export { Activity } from './Activity';
/**
* @deprecated
*/
export { Activity as Offscreen } from './Activity';

export type { ActivityMode } from './type';
/**
* @deprecated
*/
export type { ActivityMode as OffscreenMode } from './type';

0 comments on commit e374c2b

Please sign in to comment.