diff --git a/npmextra.json b/npmextra.json index 1f7910a..8fbda7f 100644 --- a/npmextra.json +++ b/npmextra.json @@ -8,14 +8,24 @@ "shortDescription": "an interface package for @pushrocks/smartfile", "npmPackagename": "@push.rocks/smartfile-interfaces", "license": "MIT", - "projectDomain": "push.rocks" + "projectDomain": "push.rocks", + "description": "Provides TypeScript interfaces for interacting with @pushrocks/smartfile, focusing on virtual directory objects.", + "keywords": [ + "typescript", + "interfaces", + "file management", + "virtual directory", + "development tools", + "code quality", + "npm package" + ] } }, "npmci": { "npmGlobalTools": [], "npmAccessLevel": "public" }, - "tsdocs": { + "tsdoc": { "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n" } } \ No newline at end of file diff --git a/package.json b/package.json index 29ef5c9..b9638ad 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@push.rocks/smartfile-interfaces", "version": "1.0.7", "private": false, - "description": "an interface package for @pushrocks/smartfile", + "description": "Provides TypeScript interfaces for interacting with @pushrocks/smartfile, focusing on virtual directory objects.", "main": "dist_ts/index.js", "typings": "dist_ts/index.d.ts", "author": "Lossless GmbH", @@ -34,5 +34,14 @@ "cli.js", "npmextra.json", "readme.md" + ], + "keywords": [ + "typescript", + "interfaces", + "file management", + "virtual directory", + "development tools", + "code quality", + "npm package" ] } \ No newline at end of file diff --git a/readme.hints.md b/readme.hints.md new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/readme.hints.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/readme.md b/readme.md index 71c3ed8..823cdc7 100644 --- a/readme.md +++ b/readme.md @@ -1,39 +1,102 @@ -# @pushrocks/smartfile-interfaces +# @push.rocks/smartfile-interfaces + an interface package for @pushrocks/smartfile -## Availabililty and Links -* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartfile-interfaces) -* [gitlab.com (source)](https://gitlab.com/pushrocks/smartfile-interfaces) -* [github.com (source mirror)](https://github.com/pushrocks/smartfile-interfaces) -* [docs (typedoc)](https://pushrocks.gitlab.io/smartfile-interfaces/) +## Install -## Status for master +To install `@push.rocks/smartfile-interfaces`, use npm: -Status Category | Status Badge --- | -- -GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartfile-interfaces/badges/master/pipeline.svg)](https://lossless.cloud) -GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartfile-interfaces/badges/master/coverage.svg)](https://lossless.cloud) -npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartfile-interfaces)](https://lossless.cloud) -Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartfile-interfaces)](https://lossless.cloud) -TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) -node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) -Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) -PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartfile-interfaces)](https://lossless.cloud) -PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartfile-interfaces)](https://lossless.cloud) -BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartfile-interfaces)](https://lossless.cloud) -Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) +```bash +npm install @push.rocks/smartfile-interfaces --save +``` + +This command will add `@push.rocks/smartfile-interfaces` as a dependency to your project and download it to the `node_modules` directory. ## Usage -Use TypeScript for best in class intellisense +Using `@push.rocks/smartfile-interfaces` in your TypeScript project is straightforward. This package provides TypeScript interfaces to enhance type checking and autocompletion when working with file-related operations, especially in projects that also use `@pushrocks/smartfile`. -## Contribution +First, ensure your TypeScript project is set up properly to use ESM syntax. You might need to include `"type": "module"` in your `package.json` or use the `.mjs` extension for your module files. -We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) +### Basic Example -For further information read the linked docs at the top of this readme. +Once you've included `@push.rocks/smartfile-interfaces` in your project, you can start using the interfaces to define types for file operations. For instance, if you're working with an object representing a virtual directory structure to be passed around in your application, you might want to use the `VirtualDirTransferableObject` interface for type safety. -> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) -| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) +```typescript +import type { VirtualDirTransferableObject } from '@push.rocks/smartfile-interfaces'; -[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) +// Example of a virtual directory object implementing the interface +const virtualDir: VirtualDirTransferableObject = { + files: [ + 'path/to/your/file1.txt', + 'path/to/your/file2.jpg', + // Add more file paths as needed + ], +}; + +console.log(virtualDir); +``` + +This simple code sample demonstrates how to use the `VirtualDirTransferableObject` interface to ensure your virtual directory objects conform to a predetermined structure, providing clearer code documentation and enhanced type safety. + +### Advanced Usage + +In a more complex application, interfaces from `@push.rocks/smartfile-interfaces` can be used in conjunction with other types and interfaces to facilitate more sophisticated file handling operations. For example, you might be creating a function responsible for processing virtual directories, filtering out specific files, or performing other actions. Leveraging TypeScript's type system can significantly reduce bugs and development time. + +```typescript +import type { VirtualDirTransferableObject } from '@push.rocks/smartfile-interfaces'; + +function processVirtualDir(virtualDir: VirtualDirTransferableObject) { + // Implement logic to process the virtual directory + // For example, filtering out non-text files + const textFiles = virtualDir.files.filter(file => file.endsWith('.txt')); + + return { + ...virtualDir, + files: textFiles, + }; +} + +// Example usage +const initialVirtualDir: VirtualDirTransferableObject = { + files: [ + 'path/to/your/file1.txt', + 'path/to/your/important.pdf', + 'path/to/your/note.txt', + ], +}; + +const processedDir = processVirtualDir(initialVirtualDir); +console.log('Processed virtual directory:', processedDir); +``` + +This advanced example showcases how to use the interface to create more reliable and maintainable code for file processing tasks in a TypeScript project. + +### Notes + +Remember, when using TypeScript, leveraging interfaces not only provides type safety but also enhances code documentation and developer experience through better autocompletion and error checking. + +As you integrate `@push.rocks/smartfile-interfaces` into larger projects, consider how these interfaces interact with other parts of your application and external libraries. The goal is to achieve a cohesive system where data structures and operations are well-defined and understood across your codebase. + +--- + +For further information and more detailed documentation, you can refer to the official TypeScript documentation on modules and namespaces, as well as consult the `@pushrocks/smartfile` documentation for additional context on how these interfaces might be used in conjunction with smartfile operations. + +## License and Legal Information + +This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. + +**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file. + +### Trademarks + +This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH. + +### Company Information + +Task Venture Capital GmbH +Registered at District court Bremen HRB 35230 HB, Germany + +For any legal inquiries or if you require further information, please contact us via email at hello@task.vc. + +By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.