Skip to content

[FEAT] Add TypeScript Support #92

@Saifullah-dev

Description

@Saifullah-dev

Description:
Convert the existing React File Manager component from JavaScript to TypeScript to provide full TypeScript type support. This feature will enhance the developer experience by providing type safety, autocompletion, and inline documentation, while still maintaining compatibility for JavaScript users.

Motivation:
Adding TypeScript support will make the component more accessible to TypeScript users, allowing them to take advantage of type checking, autocomplete suggestions, and error prevention in their IDEs. JavaScript users will continue to use the component without any required changes or enforced type constraints.

Tasks:

  1. Convert existing files to TypeScript:

    • Rename .jsx or .js files to .tsx or .ts as appropriate.
    • Add type annotations for all component props, state, and internal variables.
  2. Define and export types for component props and state:

    • Define interfaces for complex props, options, and states.
    • Add type declarations for any event handlers or callback functions used in props.
  3. Update project configurations:

    • Add a tsconfig.json file with the necessary compiler options.
    • Update build scripts (if needed) to support TypeScript.
  4. Test compatibility with JavaScript projects:

    • Ensure that JavaScript users can still import and use the component without any issues.
    • Confirm that JavaScript users are not forced into type constraints.
  5. Documentation Update:

    • Update the README or other documentation to reflect the addition of TypeScript support.
    • Provide examples for both JavaScript and TypeScript users, demonstrating how to import and use the component.

Acceptance Criteria:

  • TypeScript types are correctly defined and used throughout the codebase.
  • JavaScript users can install and use the component without encountering type errors.
  • TypeScript users benefit from autocompletion, inline type hints, and error checking.
  • Documentation is updated with examples and usage notes for both JavaScript and TypeScript users.

Additional Notes:

  • This change will not introduce breaking changes, and JavaScript users will be unaffected.
  • Test thoroughly with both JavaScript and TypeScript projects to ensure full compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions