Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Typescript Support #95

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,696 changes: 1,497 additions & 199 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"version": "1.3.4",
"description": "A simple and fully customizable React Native component that implements a progress stepper UI.",
"main": "index.js",
"types": "./types/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,6 +37,7 @@
},
"dependencies": {
"lodash": "^4.17.11",
"prop-types": "^15.6.2"
"prop-types": "^15.6.2",
"typescript": "^4.4.4"
}
}
30 changes: 30 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "es2017",
"module": "commonjs",
"jsx": "react-native",
"lib": ["es6", "esnext.asynciterable", "es2017"],
"strict": true,
"esModuleInterop": true,
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"baseUrl": ".",
"allowSyntheticDefaultImports": true,
"removeComments": true,
"declaration": true,
"allowJs": true,
"emitDeclarationOnly": true,
},
"include": [
"./src/"
],

}
2 changes: 2 additions & 0 deletions types/ProgressButtons.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default ProgressButtons;
declare function ProgressButtons(props: any): any;
51 changes: 51 additions & 0 deletions types/ProgressStep.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
export default ProgressStep;
declare class ProgressStep {
onNextStep: () => Promise<void>;
onPreviousStep: () => void;
onSubmit: () => void;
renderNextButton: () => any;
renderPreviousButton: () => any;
render(): any;
}
declare namespace ProgressStep {
namespace propTypes {
const label: any;
const onNext: any;
const onPrevious: any;
const onSubmit: any;
const setActiveStep: any;
const nextBtnText: any;
const previousBtnText: any;
const finishBtnText: any;
const stepCount: any;
const nextBtnStyle: any;
const nextBtnTextStyle: any;
const nextBtnDisabled: any;
const previousBtnStyle: any;
const previousBtnTextStyle: any;
const previousBtnDisabled: any;
const scrollViewProps: any;
const viewProps: any;
const errors: any;
const removeBtnRow: any;
const scrollable: any;
}
namespace defaultProps {
const nextBtnText_1: string;
export { nextBtnText_1 as nextBtnText };
const previousBtnText_1: string;
export { previousBtnText_1 as previousBtnText };
const finishBtnText_1: string;
export { finishBtnText_1 as finishBtnText };
const nextBtnDisabled_1: boolean;
export { nextBtnDisabled_1 as nextBtnDisabled };
const previousBtnDisabled_1: boolean;
export { previousBtnDisabled_1 as previousBtnDisabled };
const errors_1: boolean;
export { errors_1 as errors };
const removeBtnRow_1: boolean;
export { removeBtnRow_1 as removeBtnRow };
const scrollable_1: boolean;
export { scrollable_1 as scrollable };
}
}
31 changes: 31 additions & 0 deletions types/ProgressSteps.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export default ProgressSteps;
declare class ProgressSteps {
state: {
stepCount: number;
activeStep: any;
};
componentDidMount(): void;
componentDidUpdate(prevProps: any): void;
getChildProps(): any;
renderStepIcons: () => any[];
setActiveStep: (step: any) => void;
render(): any;
}
declare namespace ProgressSteps {
namespace propTypes {
const isComplete: any;
const activeStep: any;
const topOffset: any;
const marginBottom: any;
}
namespace defaultProps {
const isComplete_1: boolean;
export { isComplete_1 as isComplete };
const activeStep_1: number;
export { activeStep_1 as activeStep };
const topOffset_1: number;
export { topOffset_1 as topOffset };
const marginBottom_1: number;
export { marginBottom_1 as marginBottom };
}
}
64 changes: 64 additions & 0 deletions types/StepIcon.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
export default StepIcon;
declare class StepIcon {
render(): any;
}
declare namespace StepIcon {
namespace propTypes {
const stepCount: any;
const stepNum: any;
const isFirstStep: any;
const isLastStep: any;
const borderWidth: any;
const borderStyle: any;
const activeStepIconBorderColor: any;
const progressBarColor: any;
const completedProgressBarColor: any;
const activeStepIconColor: any;
const disabledStepIconColor: any;
const completedStepIconColor: any;
const labelFontFamily: any;
const labelColor: any;
const labelFontSize: any;
const activeLabelColor: any;
const activeLabelFontSize: any;
const completedLabelColor: any;
const activeStepNumColor: any;
const completedStepNumColor: any;
const disabledStepNumColor: any;
const completedCheckColor: any;
}
namespace defaultProps {
const borderWidth_1: number;
export { borderWidth_1 as borderWidth };
const borderStyle_1: string;
export { borderStyle_1 as borderStyle };
const activeStepIconBorderColor_1: string;
export { activeStepIconBorderColor_1 as activeStepIconBorderColor };
const progressBarColor_1: string;
export { progressBarColor_1 as progressBarColor };
const completedProgressBarColor_1: string;
export { completedProgressBarColor_1 as completedProgressBarColor };
const activeStepIconColor_1: string;
export { activeStepIconColor_1 as activeStepIconColor };
const completedStepIconColor_1: string;
export { completedStepIconColor_1 as completedStepIconColor };
const disabledStepIconColor_1: string;
export { disabledStepIconColor_1 as disabledStepIconColor };
const labelColor_1: string;
export { labelColor_1 as labelColor };
const labelFontSize_1: number;
export { labelFontSize_1 as labelFontSize };
const activeLabelColor_1: string;
export { activeLabelColor_1 as activeLabelColor };
const completedLabelColor_1: string;
export { completedLabelColor_1 as completedLabelColor };
const activeStepNumColor_1: string;
export { activeStepNumColor_1 as activeStepNumColor };
const completedStepNumColor_1: string;
export { completedStepNumColor_1 as completedStepNumColor };
const disabledStepNumColor_1: string;
export { disabledStepNumColor_1 as disabledStepNumColor };
const completedCheckColor_1: string;
export { completedCheckColor_1 as completedCheckColor };
}
}
11 changes: 11 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import ProgressButtons from './ProgressButtons'
import ProgressStep from './ProgressStep'
import ProgressSteps from './ProgressSteps'
import StepIcon from './StepIcon'

export {
ProgressButtons,
ProgressStep,
ProgressSteps,
StepIcon
}