Skip to content

Commit a123b17

Browse files
committed
chore: updated types
1 parent d6250e2 commit a123b17

File tree

8 files changed

+2399
-3778
lines changed

8 files changed

+2399
-3778
lines changed

.release-it.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,27 @@
1212
},
1313
"plugins": {
1414
"@release-it/conventional-changelog": {
15-
"preset": "angular",
15+
"preset": {
16+
"name": "conventionalcommits",
17+
"types": [
18+
{
19+
"type": "feat",
20+
"section": "🚀 New Features"
21+
},
22+
{
23+
"type": "fix",
24+
"section": "🐛 Bug Fixes"
25+
},
26+
{
27+
"type": "chore",
28+
"section": "🧹 Maintenance Chores"
29+
},
30+
{
31+
"type": "refactor",
32+
"section": "♻️ Code Refactor"
33+
}
34+
]
35+
},
1636
"infile": "CHANGELOG.md"
1737
}
1838
}

package.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"invariant": "^2.2.4"
4242
},
4343
"devDependencies": {
44-
"@commitlint/cli": "^17.6.5",
45-
"@commitlint/config-conventional": "^17.6.5",
46-
"@release-it/conventional-changelog": "^8.0.1",
44+
"@commitlint/cli": "^19.8.1",
45+
"@commitlint/config-conventional": "^19.8.1",
46+
"@release-it/conventional-changelog": "^10.0.1",
4747
"@types/invariant": "^2.2.34",
4848
"@types/react": "~18.3.12",
4949
"@types/react-native": "~0.73.0",
@@ -55,9 +55,9 @@
5555
"react-native": "0.76.0",
5656
"react-native-builder-bob": "^0.30.3",
5757
"react-native-gesture-handler": "~2.20.2",
58-
"react-native-reanimated": "~3.16.1",
59-
"release-it": "^17.6.0",
60-
"typescript": "^5.3.0"
58+
"react-native-reanimated": "~3.19.1",
59+
"release-it": "^19.0.4",
60+
"typescript": "^5.8.3"
6161
},
6262
"peerDependencies": {
6363
"@types/react": "*",
@@ -79,5 +79,11 @@
7979
"source": "src",
8080
"output": "lib",
8181
"targets": ["commonjs", "module", "typescript"]
82+
},
83+
"resolutions": {
84+
"conventional-changelog-conventionalcommits": "8.0.0"
85+
},
86+
"overrides": {
87+
"conventional-changelog-conventionalcommits": "8.0.0"
8288
}
8389
}

src/components/bottomSheet/BottomSheet.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import {
7777
DEFAULT_KEYBOARD_INPUT_MODE,
7878
DEFAULT_OVER_DRAG_RESISTANCE_FACTOR,
7979
INITIAL_POSITION,
80-
INITIAL_SNAP_POINT,
8180
INITIAL_VALUE,
8281
} from './constants';
8382
import type { AnimateToPositionType, BottomSheetProps } from './types';

src/components/bottomSheetDebugView/ReText.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ const ReText = ({ text, value: _providedValue, style }: TextProps) => {
2323
return '';
2424
}
2525

26-
const rawValue =
27-
typeof _providedValue === 'number'
28-
? _providedValue
29-
: typeof _providedValue.get() === 'number'
30-
? _providedValue.get().toFixed(2)
31-
: _providedValue.get();
26+
let rawValue: number | string | object | boolean = '';
27+
if (typeof _providedValue === 'number') {
28+
rawValue = _providedValue as number;
29+
} else if (typeof _providedValue.get === 'function') {
30+
rawValue = _providedValue.get();
31+
}
3232

3333
if (typeof rawValue === 'object') {
3434
const rawValueObject = Object.entries(rawValue)
@@ -45,6 +45,10 @@ const ReText = ({ text, value: _providedValue, style }: TextProps) => {
4545
return `${text}\n${rawValueObject}`;
4646
}
4747

48+
if (typeof rawValue === 'number') {
49+
rawValue = rawValue.toFixed(2);
50+
}
51+
4852
return `${text}: ${rawValue}`;
4953
}, [text, _providedValue]);
5054
const animatedProps = useAnimatedProps(() => {

src/constants.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { Dimensions, Platform } from 'react-native';
22
import type Animated from 'react-native-reanimated';
3-
import {
4-
Easing,
5-
type WithSpringConfig,
6-
type WithTimingConfig,
7-
} from 'react-native-reanimated';
3+
import { Easing } from 'react-native-reanimated';
4+
import type { SpringConfig, TimingConfig } from './types';
85

96
const { height: WINDOW_HEIGHT, width: WINDOW_WIDTH } = Dimensions.get('window');
107
const { height: SCREEN_HEIGHT, width: SCREEN_WIDTH } = Dimensions.get('screen');
@@ -75,7 +72,7 @@ enum SNAP_POINT_TYPE {
7572
const ANIMATION_EASING: Animated.EasingFunction = Easing.out(Easing.exp);
7673
const ANIMATION_DURATION = 250;
7774

78-
const ANIMATION_CONFIGS = Platform.select<WithTimingConfig | WithSpringConfig>({
75+
const ANIMATION_CONFIGS = Platform.select<TimingConfig | SpringConfig>({
7976
android: {
8077
duration: ANIMATION_DURATION,
8178
easing: ANIMATION_EASING,

src/contexts/internal.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import type {
66
BottomSheetGestureProps,
77
BottomSheetProps,
88
} from '../components/bottomSheet/types';
9-
import type {
10-
ANIMATION_STATUS,
11-
SCROLLABLE_STATUS,
12-
SCROLLABLE_TYPE,
13-
SHEET_STATE,
14-
} from '../constants';
9+
import type { SCROLLABLE_STATUS, SHEET_STATE } from '../constants';
1510
import type {
1611
AnimationState,
1712
DetentsState,

src/types.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import type {
1818
State,
1919
} from 'react-native-gesture-handler';
2020
import type {
21+
EasingFunction,
22+
EasingFunctionFactory,
23+
ReduceMotion,
2124
SharedValue,
2225
WithSpringConfig,
2326
WithTimingConfig,
@@ -139,6 +142,36 @@ export type ScrollableEvent = (
139142
//#endregion
140143

141144
//#region utils
145+
export interface TimingConfig {
146+
duration?: number;
147+
reduceMotion?: ReduceMotion;
148+
easing?: EasingFunction | EasingFunctionFactory;
149+
}
150+
151+
export type SpringConfig = {
152+
stiffness?: number;
153+
overshootClamping?: boolean;
154+
restDisplacementThreshold?: number;
155+
restSpeedThreshold?: number;
156+
velocity?: number;
157+
reduceMotion?: ReduceMotion;
158+
} & (
159+
| {
160+
mass?: number;
161+
damping?: number;
162+
duration?: never;
163+
dampingRatio?: never;
164+
clamp?: never;
165+
}
166+
| {
167+
mass?: never;
168+
damping?: never;
169+
duration?: number;
170+
dampingRatio?: number;
171+
clamp?: { min?: number; max?: number };
172+
}
173+
);
174+
142175
export type Primitive = string | number | boolean;
143176
//#endregion
144177

0 commit comments

Comments
 (0)