diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3e175b..1fd87f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,16 +40,16 @@ NOTE: Part of this will only take effect once this repository becomes public. Pl 2. Assign the issue to yourself, or ask to have it assigned to you. 3. Fork [this repository](https://github.com/4lex0017/AudioStreamSplitting) to your own account. 4. Implement your contribution and commit it to your forked repository. Be sure to follow the requirements outlined in [Requirements](#requirements). Test your implementation and ensure the program builds on your system. - - If something about the user workflow, the code structure, available commands or other usage details documented in this document and the [README.md](./README.MD) file is changed, also update the corresponding document(s) accordingly. + - If something about the user workflow, the code structure, available commands or other usage details documented in this document and the [README.md](./README.MD) file is changed, also update the corresponding document(s) accordingly. Ensure the documents don't contain spelling errors. 5. Create a pull request on this repository. 6. The pull request must be approved by at least two of the main maintainers of AudioStreamSplitting (as of current, that's @chubetho, @ChrisItisdud, @4lex0017 and @JosuaE-FHWS). Reviewers must also attempt to build and run the project locally to verify everything works fine. -7. After two approvals, the pull request gets merged. +7. After two approvals, the pull request gets merged. The merge should use squash merge in order to keep commit history reasonable on the main branch. ### Requirements The following requirements must be met by the system at any time: -1. Every function has documentation comments, formatted in the reST doc format. An example comment is shown below. These documentation comments are used to [generate the back-end documentation](#generating-documentation). +1. Every function has documentation comments, formatted in the reST doc format. An example comment is shown below. These documentation comments are used to [generate the documentation](#generating-documentation). Ensure the documentation comments build correctly and don't contain spelling errors. 2. All python code must comply to [the black code style](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html). 3. All back-end/python code that can have unit tests (i.e. doesn't rely on files on the file system, external APIs or other outside resources) must have them. When adding a new module, add an according test file in the backend/tests folder. When updating an existing one, add or update tests in the correlating test file. All tests must pass (obviously). 4. All business logic must be in the back-end. The front-end should only contain the user interface. @@ -124,7 +124,7 @@ Tests are situated in ``backend/tests``. Each module that has unit tests has its ### Generating documentation -To generate and show documentation, run ``npm run docs``. This will generate back-end and front-end documentation and show it on a local server easily accessible on your browser (usually [localhost:5173](http://localhost:5173/)). Alternatively, you can find HTML docs for the back-end in docs/_build/html. Also showing the documentation as Github pages is planned for the future, but cannot be done before this repository goes public. +To generate and show documentation, run ``npm run docs``. This will generate back-end and front-end documentation and show it on a local server easily accessible on your browser (usually [localhost:5173](http://localhost:5173/)). Alternatively, you can find HTML docs for the back-end in docs/_build/html. The documentation is also available on [Github pages](https://4lex0017.github.io/AudioStreamSplitting/). ## Developing Environment @@ -180,21 +180,33 @@ npm run dev:be ``` ```bash -npm run dev:be +npm run dev:fe ``` +If ``npm run dev:be`` fails, check if the python executable the command calls is correct. If not, either call the command manually or change it in ``package.json`` (but don't commit the change!) + #### Available commands -| Command | Description | -| ------------------------ | --------------------------------- | -| npm run `dev:fe` | Run frontend server | -| npm run `dev:be` | Run backend server | -| npm run `view:app` | Run desktop app | -| npm run `build:fe` | Build frontend (html, js, css) | -| npm run `build:app` | Build desktop app | -| npm run `docs:gen:be` | Generate backend documentation | -| npm run `docs:gen:fe` | Generate backend documentation | -| npm run `docs` | Generate and show documentation | +| Command | Description | +| --------------------------- | --------------------------------- | +| npm run `dev:fe` | Run frontend server | +| npm run `dev:be` | Run backend server | +| npm run `test:fe` | Run frontend tests | +| npm run `test:be` | Run backend tests | +| npm run `view:app` | Run desktop app | +| npm run `build:fe` | Build frontend (html, js, css) | +| npm run `build:app` | Build desktop app | +| npm run `build:app:nocheck` | Build desktop app without checks | +| npm run `lint:fe` | Run frontend linter | +| npm run `lint:be` | Run backend linter | +| npm run `format:be` | Run backend formatter | +| npm run `typecheck` | Run frontend typechecker | +| npm run `orval` | Generate API call functions | +| npm run `docs:gen:be` | Generate backend documentation | +| npm run `docs:gen:fe` | Generate backend documentation | +| npm run `docs:gen` | Generate full documentation | +| npm run `docs:build` | Generate and build documentation | +| npm run `docs` | Generate and show documentation | ## Contributors diff --git a/README.MD b/README.MD index 0ee02a7..ad795bf 100644 --- a/README.MD +++ b/README.MD @@ -76,12 +76,20 @@ The buttons below the waveform window allow you to download, play back or delete #### Settings -The settings tab allows you to configure AudioStreamSplitting to your liking: +The settings tab allows you to configure AudioStreamSplitting to your liking. Each field has a short description below it to explain what it does:

The language field currently supports English, German, French and Spanish. Note that only the English and German translations are actively maintained, so translation issues will arise when using the other languages. +The "Save" section is where the settings related to saving files are situated. + +The "Save Directory" setting should be set to the directory you want to save the resulting files into. Make sure that this is an existing directory on your device, as saving files will not work otherwise. + +The "Output File Name" setting will control the file name of output files. You can include the placeholders ``{TITLE}``, ``{ARTIST}``, ``{ALBUM}`` and ``{YEAR}``, which will be replaced with the corresponding metadata when saving a song. As an example, saving the song "Thunderstruck" by "2Cellos" with the template ``"{TITLE}_{ARTIST}"`` will result in a file called ``"Thunderstruck_2Cellos.mp3"``. It is strongly recommended to include the ``{TITLE}`` placeholder in the file name to avoid overwriting files. + +The "Submit files to APIs on save" setting controls whether files the app identified will also be sent to the AcoustID API (and potentially others in the future) to further improve their database. As far as we can tell, no personally identifying data is submitted, and the data that is submitted is only used to ensure you have access to the API. We kindly ask you to turn this setting on as the AcoustID database depends on user submissions to work as well as it does. + Turning off the "Ask me what to do with each save" option allows choosing a file type, which all files will be saved as by default. If this is not set, you will instead be asked to choose a file type every time you save a file. The "Advanced" section is where the most important settings are situated. Note that for changes to these settings to apply, you must click the "Set" button next to the setting you changed. @@ -90,12 +98,6 @@ You need to provide at least one API Key for the song identification to work, bu The AcoustID API keys are split into two keys: The "AcoustID Application API Key" is the key you receive when registering an application. This key is necessary for any functionality involving AcoustID. The "AcoustID User API Key" is only required if you also want to submit identified songs to AcoustID. -The "Save Directory" setting should be set to the directory you want to save the resulting files into. Make sure that this is an existing directory on your device, as saving files will not work otherwise. - -The "Output File Name" setting will control the file name of output files. You can include the placeholders ``{TITLE}``, ``{ARTIST}``, ``{ALBUM}`` and ``{YEAR}``, which will be replaced with the corresponding metadata when saving a song. As an example, saving the song "Thunderstruck" by "2Cellos" with the template ``"{TITLE}_{ARTIST}"`` will result in a file called ``"Thunderstruck_2Cellos.mp3"``. It is strongly recommended to include the ``{TITLE}`` placeholder in the file name to avoid overwriting files. - -The "Submit files to APIs on save" setting controls whether files the app identified will also be sent to the AcoustID API (and potentially others in the future) to further improve their database. As far as we can tell, no personally identifying data is submitted, and the data that is submitted is only used to ensure you have access to the API. We kindly ask you to turn this setting on as the AcoustID database depends on user submissions to work as well as it does. - ## License This software is licensed under the GNU GPLv3 license, as found in the LICENSE.txt file or [on the GNU website](https://www.gnu.org/licenses/gpl-3.0.en.html). Note that this license only applies to the software itself, not to audio files generated by it, as they still belong to the songs' original copyright holders. diff --git a/assets/settings.jpg b/assets/settings.jpg index 2342273..3fc058e 100644 Binary files a/assets/settings.jpg and b/assets/settings.jpg differ diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index b399ea5..bda2eb9 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -50,7 +50,8 @@ export default defineConfig({ ignoreDeadLinks: true, base: '/AudioStreamSplitting', - head: [['link', { rel: 'icon', type: 'image/x-icon', href: '/logo.ico' }]], + head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]], + themeConfig: { logo: '/logo.ico', nav: [ diff --git a/docs/backend/backend_module_docs/api_service.md b/docs/backend/backend_module_docs/api_service.md deleted file mode 100644 index cb66a2e..0000000 --- a/docs/backend/backend_module_docs/api_service.md +++ /dev/null @@ -1,410 +0,0 @@ -# Module API Service - -This class provides utilities for identifying songs using various song recognition APIs. Currently, the [Shazam API](https://rapidapi.com/apidojo/api/shazam) and [AcoustID](https://acoustid.org/) are supported. Support for other APIs might be added in the future (see issue #53). - -To aid in finding segmentation errors, the service is stateful. The currently identified song as well as the last one are stored to allow concatenating segments in case the splitting was too eager. Songs are stored as their duration, their starting offset in a given file as well as their metadata options as gathered from song recognition APIs. - -An example for the general workflow of the API service can be found in ``identify_all_from_generator``. - -## Contents - -Classes: - -- [``SongOptionResult``](#songoptionresult) -- [``ApiService``](#apiservice) - -## Classes - -### SongOptionResult - -Enum containing all possible results of ``get_song_options``: - -- ``SONG_EXTENDED: 0``: The previous and current song segments are the same song. This happens if the segmentation algorithm split a song in the middle. The previous segment has been extended to include the current one. -- ``SONG_FINISHED: 1``: The previous and current song segments are different songs. The previous segment has been stored in the ``last_song_*`` variables and can be retrieved using [``get_last_song``](#get_last_song). -- ``SONG_MISMATCH: 2``: The current song segment is recognised as a different song in the beginning and end. This happens if the segmentation algorithm didn't detect a change of songs. To solve this, the front-end should prompt the user to manually place the missing split. The previous segment has been stored in the ``last_song_*`` variables and can be retrieved using [``get_last_song``](#get_last_song). -- ``SONG_NOT_RECOGNISED: 3``: The current song segment couldn't be recognised. This happens if none of the song recognition APIs the user provided API keys for know the given song. The previous segment has been stored in the ``last_song_*`` variables and can be retrieved using [``get_last_song``](#get_last_song). - -### ApiService - -The ApiService class contains the business logic for retrieving song metadata via various song identification APIs. - -The currently analyzed song is stored in the ``current_song_*`` attributes, formatted as an offset and a duration to indicate its position in the analyzed file and the metadata options for the song, as gathered from the song recognition APIs. Once a new segment's metadata doesn't match the currently analyzed song, the current song is stored in the ``last_song_*`` attributes and can be retrieved using [``get_last_song``](#get_last_song). - -The workflow of using the API service, as implemented in [``identify_all_from_generator``](#identify_all_from_generator), should look as follows: - -```python -import modules.api_service - -segments = [(0, 160), (160, 90), (250, 110.4)] # the segment data - this will usually come from segmentation.py -filename = "my_file.mp3" # the target file -service = ApiService() -result_segments = [] -first_segment = True -for offset, duration in segments: - result = service.get_song_options(offset, duration, filename) - if (result is SongOptionResult.SONG_FINISHED or SongOptionResult.SONG_NOT_RECOGNISED and first_segment = False) or result is SongOptionResult.SONG_MISMATCH: - result_segments.append(service.get_last_song()) - if (result is not SongOptionResult.SONG_EXTENDED) - first_segment = False -result_segments.append(service.get_final_song()) -print(result_segments) -``` - -The condition involving ``first_segment`` is required as the service is initialised with placeholder values, which are written to the ``last_song_*`` attributes the first time a segment is passed in. - -#### ApiService:Contents - -Attributes: - -- [``last_song_offset``](#apiservicelast_song_offset) -- [``last_song_duration``](#apiservicelast_song_duration) -- [``last_song_metadata_options``](#apiservicelast_song_metadata_options) -- [``current_song_offset``](#apiservicecurrent_song_offset) -- [``current_song_duration``](#apiservicecurrent_song_duration) -- [``current_song_metadata_options``](#apiservicecurrent_song_metadata_options) - -Public functions: - -- [``identify_all_from_generator``](#identify_all_from_generator) -- [``get_last_song``](#get_last_song) -- [``get_final_song``](#get_final_song) -- [``get_song_options``](#get_song_options) - -Private functions: - -- [``_song_export``](#_song_export) -- [``_check_song_extended_or_finished``](#_check_song_extended_or_finished) -- [``_get_overlapping_metadata_values``](#_get_overlapping_metadata_values) -- [``_create_fingerprint``](#_create_fingerprint) -- [``_get_api_song_data_acoustid``](#_get_api_song_data_acoustid) -- [``_store_finished_song``](#_store_finished_song) - -#### ApiService:Attributes - -##### ApiService.last_song_offset - -``float`` Offset of the last finished segment. This is always >= 0 and smaller than the analyzed file's duration. - -##### ApiService.last_song_duration - -``float`` Duration of the last finished segment. This is always > 0 and smaller than the analyzed file's duration minus ``last_song_offset``. - -##### ApiService.last_song_metadata_options - -``dict`` Metadata options for the last finished segment. This can contain attributes for the song's title, artist, album and year. - -``title`` and ``artist`` must always be set. ``album`` and ``year`` will not be set if the service didn't offer them. - -Example: - -```python -{ - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" -} -``` - -##### ApiService.current_song_offset - -Offset of the currently analyzed segment. This is always >= 0 and smaller than the analyzed file's duration. If segments are properly provided in sequence, ``current_song_offset == last_song_offset + last_song_duration`` will always be true. - -##### ApiService.current_song_duration - -Duration of the currently analyzed segment. This is always > 0 and smaller than the analyzed file's duration minus ``current_song_offset``. - -##### ApiService.current_song_metadata_options - -``dict`` Metadata options for the currently analyzed segment. This can contain attributes for the song's title, artist, album and year. - -``title`` and ``artist`` must always be set. ``album`` and ``year`` will not be set if the service didn't offer them. - -Example: - -```python -{ - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" -} -``` - -#### ApiService:Public functions - -##### identify_all_from_generator - -Identify all song segments provided by a generator, which should be created by ``modules/segmentation.py``. - -This function will iterate over every segment the generator provides and call ``get_song_options`` with its parameters. Whenever a song is not extended, the result is written to the ``segments`` list. If ``get_song_options`` returns [``SongOptionResult.SONG_MISMATCH``](#songoptionresult), the segment's offset is additionally written to the ``mismatch_offsets`` list. - -###### identify_all_from_generator:Arguments - -- ``generator: Generator``: A generator (generated by ``modules/segmentation.py``) that provides tuples of song data as ``(offset: float, duration: float)``. The first provided tuple is only left for historic reasons and should be refactored out eventually. -- ``file_path: str``: The path to the analysed file. This needs to be properly formatted for the operating system this program is running in, so using ``\`` for Windows and ``/`` for \*nix systems. - -###### identify_all_from_generator:Returns - -Tuple ``(segments, mismatch_offsets)``. - -- ``segments``: A list containing all the identified segments, formatted as a ``dict`` with the keys ``offset`` for the segment start, ``duration`` for the segment duration and ``metadataOptions`` for the metadata options. -- ``mismatch_offsets`` contains all ``offset`` values from ``segments`` where [``SongOptionResult.SONG_MISMATCH``](#songoptionresult) occurred. - -###### identify_all_from_generator:Example - -Example: Simply segment a file and identify all segments. - -```python -import modules.segmentation -import modules.api_service - -api_service = ApiService() -generator = segment_file("my_file.mp3") -segments, mismatches = api_service.identify_all_from_generator(generator, "my_file.mp3") -print("Segments:") -print(segments) -print("Mismatches:") -print(mismatches) -``` - -###### identify_all_songs_from_generator:Raises - -- ``requests.exceptions.RequestException`` if a Shazam request fails due to too many redirections or other problems. ``ConnectionError``s are caught within the function, but other errors are not. A detailed list of Exceptions ``requests``can raise can be found in [the ``requests`` documentation](https://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions) - -##### get_last_song - -Retrieve a finished song. This should be called whenever [``get_song_options``](#get_song_options) returns [``SongOptionResult.SONG_FINISHED``](#songoptionresult), except for the first time (as it will then contain empty metadata). - -###### get_last_song:Arguments - -###### get_last_song:Returns - -A ``dict`` with the keys ``offset`` for the segment start, ``duration`` for the segment duration and ``metadataOptions`` for the metadata options. - -Example: - -```python -{ - "offset": 195.2 - "duration": 170 - "metadataOptions": [ - { - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" - }, - { - "title": "Thunderstruck", - "artist": "2Cellos" - } - ] -} -``` - -##### get_final_song - -Retrieve the final song. This should be called after calling [``get_song_options``](#get_song_options) for the last time for a file. This should be the very last call to an ``ApiService`` instance. - -###### get_final_song:Arguments - -###### get_final_song:Returns - -A ``dict`` with the keys ``offset`` for the segment start, ``duration`` for the segment duration and ``metadataOptions`` for the metadata options. - -Example: - -```python -{ - "offset": 195.2 - "duration": 170 - "metadataOptions": [ - { - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" - }, - { - "title": "Thunderstruck", - "artist": "2Cellos" - } - ] -} -``` - -##### get_song_options - -Call the song recognition APIs the user has provided an API key for and attempt to identify the given segment of the given file. - -If keys for multiple song recognition APIs are provided, AcoustID is queried first as it is fully free. Thus, if AcoustID can identify a song, limited or costly requests to other services can be saved for songs AcoustID cannot identify. The order of other API calls, if more song recognition APIs besides AcoustID and Shazam are added, is irrelevant, although it would be best practice to order them by cost per request so as to limit fees for users. - -The check for whether the given segment matches the currently analyzed song, as implemented in [``_get_overlapping_metadata_values``](#_get_overlapping_metadata_values) only accounts for song title and artist. If other metadata differ, the currently analyzed song's metadata are used. - -###### get_song_options:Arguments - -- ``offset: float``: The offset at which the segment begins, in seconds. -- ``duration: float``: The duration of the segment, in seconds. -- ``file_path: str``: The path to the analyzed file. This needs to be properly formatted for the operating system this program is running in, so using ``\`` for Windows and ``/`` for \*nix systems. - -###### get_song_options:Returns - -[``SongOptionResult``](#songoptionresult) indicating the new state of the service. - -#### get_song_options:Raises - -- ``requests.exceptions.RequestException`` if a Shazam request fails due to too many redirections or other problems. ``ConnectionError``s are caught within the function, but other errors are not. A detailed list of Exceptions ``requests``can raise can be found in [the ``requests`` documentation](https://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions) - -#### ApiService:Private functions - -While these functions aren't "private" in the sense that they cannot be accessed from the outside, they should not be called from outside this file. - -##### _song_export - -Format the given offset, duration and metadata as a dict for the API. This is used for formatting for [``get_last_song``](#get_last_song) and [``get_final_song``](#get_final_song). - -###### _song_export:Arguments - -- ``offset: float``: The offset at which the segment begins, in seconds. -- ``duration: float``: The duration of the segment, in seconds. -- ``metadata_options: list``: A list of the metadata options, formatted as dicts. - -###### _song_export:Returns - -A ``dict`` with the keys ``offset`` for the segment start, ``duration`` for the segment duration and ``metadataOptions`` for the metadata options. - -Example: - -```python -{ - "offset": 195.2 - "duration": 170 - "metadataOptions": [ - { - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" - }, - { - "title": "Thunderstruck", - "artist": "2Cellos" - } - ] -} -``` - -##### _check_song_extended_or_finished - -Check if the metadata options of the analyzed segment match those of the previous segment. Store the finished song if applicable. - -The check for whether the given segment matches the currently analyzed song, as implemented in [``_get_overlapping_metadata_values``](#_get_overlapping_metadata_values) only accounts for song title and artist. If other metadata differ, the currently analyzed song's metadata are used. - -###### _check_song_extended_or_finished:Arguments - -- ``offset: float``: The offset at which the analyzed segment begins, in seconds. -- ``duration: float``: The duration of the analyzed segment, in seconds. -- ``metadata_options: list``: A list of the metadata options for the analyzed segment, formatted as dicts. - -###### _check_song_extended_or_finished:Returns - -[``SongOptionResult``](#songoptionresult) indicating whether the previous segment was extended or finished. - -##### _get_overlapping_metadata_values - -From two sets of metadata, get all that have the same artist and title. If either of the sets is empty, return the other set. - -If metadata other than artist and title mismatch, the metadata from ``metadata1`` are used, even if that means discarding data that is empty in ``metadata1`` and set in ``metadata2``. - -###### _get_overlapping_metadata_values:Arguments - -- ``metadata1: list``: First list of metadata to compare. -- ``metadata2: list``: Second list of metadata to compare. - -###### _get_overlapping_metadata_values:Returns - -A ``list`` of the matching metadata options. - -Example: - -```python -[ - { - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" - }, - { - "title": "Thunderstruck", - "artist": "2Cellos" - } -] -``` - -##### _create_fingerprint - -Create a [chromaprint/AcoustID](https://github.com/acoustid/chromaprint) fingerprint for the given audio data in order to identify it using [AcoustID](https://acoustid.org). - -As of current, this works by writing the data to a temporary file and using the ``fpcalc`` command line tool to generate the fingerprint. The temporary file is deleted immediately afterwards. If it becomes feasible to build and distribute DLL versions of ``chromaprint`` for all target platforms, this should be refactored to use that instead. - -###### _create_fingerprint:Arguments - -- ``song_data: numpy.ndarray`` The song data to generate a fingerprint from. -- ``samplerate: int`` The sample rate of the song data. - -###### _create_fingerprint:Returns - -Tuple ``(song_duration, fingerprint)``. The ``song_duration`` is measured in seconds and used for the API call to AcoustID. The ``fingerprint`` is generated by ``fpcalc``. - -###### _create_fingerprint:Raises - -- ``acoustid.NoBackendError`` if ``fpcalc`` is not installed. -- ``acoustid.FingerprintGenerationError`` if fingerprint generation fails. - -##### _get_api_song_data_acoustid - -Get data about the provided fingerprint from the [AcoustID](https://acoustid.org) API. - -This uses the ``pyacoustid`` library as a wrapper, which will only return the song's title and artist, as well as a match score and the MusicBrainz ID, although those are discarded as they have no further use. This should be enhanced to include a second call to the AcoustID API that gathers more metadata for the song using the MusizcBrainz ID. - -###### _get_api_song_data_acoustid:Arguments - -- ``fingerprint: str`` The fingerprint generated using [``create_fingerprint``](#_create_fingerprint) or other usage of [chromaprint](https://github.com/acoustid/chromaprint). -- ``fingerprint_duration: float`` The duration of the fingerprinted data, in seconds. - -###### _get_api_song_data_acoustid:Returns - -A ``list`` of ``dict``s containing the results. The ``dict``s have the keys ``"artist"`` for the artist name and ``"title"`` for the song title. - -Example: - -```python -[ - { - "title": "Thunderstruck", - "artist": "AC/DC", - }, - { - "title": "Thunderstruck", - "artist": "2Cellos" - } -] -``` - -###### _get_api_song_data_acoustid:Raises - -- ``acoustid.WebServiceError`` if the request fails. - -##### _store_finished_song - -Store the data from the ``current_song_*`` variables in the ``last_song_*`` variables and replace the ``current_song_*`` variables with the provided data. This is used to correctly change the service's state in [``get_song_options``](#get_song_options) and functions called by it. - -###### _store_finished_song:Arguments - -- ``offset: float``: The new currently read song's offset, in seconds. -- ``duration: float``: The new currently read song's duration, in seconds. -- ``metadata_options: dict``: The new currently read song's metadata options. - -###### _store_finished_song:Returns diff --git a/docs/backend/backend_module_docs/audio_stream_io.md b/docs/backend/backend_module_docs/audio_stream_io.md deleted file mode 100644 index 9b8b7ae..0000000 --- a/docs/backend/backend_module_docs/audio_stream_io.md +++ /dev/null @@ -1,97 +0,0 @@ -# Audio Stream IO - -## Contents - -Public functions: - -- [read\_audio\_file\_to\_numpy](#read_audio_file_to_numpy) -- [read\_audio\_file\_to\_stream](#read_audio_file_to_stream) -- [overlapping\_stream](#overlapping_stream) -- [save\_numpy\_as\_audio\_file](#save_numpy_as_audio_file) -- [tag\_audio\_file](#tag_audio_file) - -## Public functions - -### read_audio_file_to_numpy - -Reads a file to load as a NumPy array. - -#### read_audio_file_to_numpy:Arguments - -- `` audiofile: string|path `` Path to audiofile -- `` mono: bool `` If true, convert to mono. -- `` offset: float `` Start of the segment to read, in seconds. -- `` duration: float `` Duration of the segment to read, in seconds. -- `` sample_rate: int `` Sample rate, defaults to Librosa standard 22050 Hz. - -#### read_audio_file_to_numpy:Returns - -Returns a ``Tuple[numpy.ndarray,float]`` of sound data. - -### read_audio_file_to_stream - -Reads an audio file as a stream. - -#### read_audio_file_to_stream:Arguments - -- `` audiofile: string `` Path to audio file -- `` block_len: int `` Block length of stream -- `` mono: bool `` If true, convert to mono. - -#### read_audio_file_to_stream:Returns - -Returns an `` audiostream: Generator `` the `` samplerate: int `` and the `` hop_length: int ``. - -### overlapping_stream - -Gets a stream and returns it with 75% overlap between each instance. - -#### overlapping_stream:Arguments - -- `` stream: Generator `` Takes a generator of stereo audio file data with the size $2\times x$ (2 channels) with $x$ as the block size. - -#### overlapping_stream:Retruns - -Returns a `` Generator `` with the size $2\times y$ (2 channels) with $y$ as the block size. - -### save_numpy_as_audio_file - -#### save_numpy_as_audio_file:Arguments - -- `` song: numpy.ndarray `` Numpy array of the song -- `` songname: string `` Name of the song -- `` file_path: string|path `` Path to file (without file name) -- `` rate: int `` Samplerate of the song {Default: 100} -- `` tags: dict `` Dict of tags {Default: {}} see [Tags](#tag_audio_file) -- `` extension: string `` String of the extension {Default: ".mp3"} - -### tag_audio_file - -#### tag_audio_file:Arguments - -- `` savename: string|path `` Path to save file -- `` songname: string `` Name of the song -- `` tags: dict `` A dict of tags - -##### tag_audio_file:Arguments:tags - -Possible tags are: - -- album -- albumartist -- artist -- artwork -- comment -- compilation -- composer -- discnumber -- genre -- lyrics -- totaldiscs -- totaltracks -- tracknumber -- tracktitle -- year -- isrc - -Also some aliases like album -> albumname are possible. diff --git a/docs/backend/backend_module_docs/file_name_formatter.md b/docs/backend/backend_module_docs/file_name_formatter.md deleted file mode 100644 index 6b6a9f4..0000000 --- a/docs/backend/backend_module_docs/file_name_formatter.md +++ /dev/null @@ -1,43 +0,0 @@ -# File Name Formatter - -This class provides functionality to format file names for finished songs based on a template. - -## Contents - -Public functions: - -- [``format_file_name``](#format_file_name) -- [``replace_all``](#replace_all) - -## Public functions - -### format_file_name - -Format a file name based on the given template and metadata. The template should contain at least one of the placeholders ``{TITLE}``, ``{ARTIST}``, ``{ALBUM}``, ``{YEAR}``, which will be replaced with the provided metadata. - -#### format_file_name:Arguments - -- ``template: str``: The template to replace metadata into. -- ``title: str``: The song title. -- ``artist: str``: The artist name. -- ``album: str``: The album name. -- ``year: str``: The song's release year. - -#### format_file_name:Returns - -``str`` containing the formatted text. - -### replace_all - -Replace all occurences of the given dict keys with the given dict values. - -NOTE: Do not use this function if the order in which keys are replaced is relevant. For example, if you have a ``replacements`` dict like ``{"house": "home", "om": "em"}``, the resulting example for ``"house om"`` will not be ``"home em"`` but ``"heme em"``. - -#### replace_all:Arguments - -- ``text: str``: The haystack to find and replace in. -- ``replacements: dict``: The keys and values to replace, formatted as ``{"find": "replace"}`` - -#### replace_all:Returns - -``str`` containing the text after replacing. diff --git a/docs/backend/backend_module_docs/segmentation.md b/docs/backend/backend_module_docs/segmentation.md deleted file mode 100644 index d4f4f33..0000000 --- a/docs/backend/backend_module_docs/segmentation.md +++ /dev/null @@ -1,276 +0,0 @@ -# Segmentation - -This file provides all functions necessary to split an audio file into smaller segments. -Where each segment represents a distinct portion of the file. Segmentation works on mono -audio, if stereo is provided it will be transformed to mono. - -If a file containing multiple songs is given, the resulting segments will represent the individual songs. -If a file containing one song is given, it may split the song into its multiple parts. - -This segmentation is based on a computed self similarity matrix and its novelty function and may be faulty. -If there are no clear transitions or consecutive similar audio, splits may be missing. Generally this method -adds more splits than necessary, since songs often have strong dissimilarities within themselves. - - -## Contents - -Classes: - -- [``FeatureType``](#FeatureType) -- [``Preset``](#Preset) - -Functions: - -- [``extract_chroma``](#extract_chroma) -- [``extract_spectro``](#extract_spectro) -- [``smooth_downsample_feature_sequence``](#smooth_downsample_feature_sequence) -- [``median_downsample_feature_sequence``](#median_downsample_feature_sequence) -- [``normalize_feature_sequence``](#normalize_feature_sequence) -- [``create_gaussian_checkerboard_kernel``](#create_gaussian_checkerboard_kernel) -- [``compute_self_similarity``](#compute_self_similarity) -- [``compute_novelty_ssm``](#compute_novelty_ssm) -- [``select_peaks``](#select_peaks) -- [``filter_peaks``](#filter_peaks) -- [``segment_block``](#segment_block) -- [``segment_file``](#segment_file) - - -## Classes - -### FeatureType - -Enum containing all Features we would want to extract from the audio. - -- ``CHROMA``: -- ``SPECTRAL``: - -### Preset - -Enum containing several presets of values used for splitting. -Set values are the length of the smoothing filter, downsampling factor and peak threshold. - -- ``EXTRA_STRICT`` -- ``STRICT`` -- ``NORMAL`` -- ``LENIENT`` -- ``EXTRA_LENIENT`` - -NORMAL is the recommended Preset. -STRICT and EXTRA_STRICT may result in missing segments. -LENIENT and EXTRA_LENIENT may not only result in more segments but also in faultier ones. - - -## Functions - -### extract_chroma - -Computes a chromagram feature vector on the given sequence. - -#### extract_chroma:Arguments - -- ``feature``: The feature sequence -- ``samplerate``: The samplerate of the audio -- ``hop_length: int``: The amount of samples advanced between each frame in the audio -- ``fft_window: int``: The window size used for fast-fourier-transformation - -#### extract_chroma:Returns - -A chroma feature vector. - - -### extract_spectro - -Computes a mel-scaled spectrogram feature vector on the given sequence. - -#### extract_spectro:Arguments - -- ``feature``: The feature sequence -- ``samplerate``: The samplerate of the audio -- ``hop_length: int``: The amount of samples advanced between each frame in the audio -- ``fft_window: int``: The window size used for fast-fourier-transformation - -#### extract_spectro:Returns - -A mel-scaled spectrogram feature vector. - - -### smooth_downsample_feature_sequence - -Blur the given feature sequence and downsamples it by the given factor. - -#### smooth_downsample_feature_sequence:Arguments - -- ``feature``: The feature sequence -- ``samplerate``: The samplerate of the feature sequence -- ``filter_len: int``: The length of the smoothing filter. Has to be odd (if even will be incremented). -- ``downsampling: int``: The downsampling factor. - -#### smooth_downsample_feature_sequence:Returns - -The downsampled and smoothed feature sequence. - - -### median_downsample_feature_sequence - -Compute a 2D median filter on the given feature sequence and downsample it by the given -factor. - -#### median_downsample_feature_sequence:Arguments - -- ``feature``: The feature sequence -- ``samplerate``: The samplerate of the feature sequence -- ``filter_len: int``: The length of the median filter. Has to be odd (if even will be incremented). -- ``downsampling: int``: The downsampling factor. - -#### median_downsample_feature_sequence:Returns - -The downsampled and smoothed feature sequence. - - -### normalize_feature_sequence - -Normalize a given feature sequence using a L2-norm to a range of [0.0 - 1.0]. - -#### normalize_feature_sequence:Arguments - -- ``feature``: The feature sequence to normalize. - -#### normalize_feature_sequence:Returns - -The normalized feature sequence. - - -### create_gaussian_checkerboard_kernel - -Computes a checkerboard kernel convolved with a 2D gaussian. -Used to detect corners on the blurred self similarity matrix. - -#### create_gaussian_checkerboard_kernel:Arguments - -- ``n: int``: The resulting kernel length will be 2 * n + 1 -- ``var: float``: The variance of the gaussian kernel -- ``normalize: bool``: Whether to normalize the kernel - -#### create_gaussian_checkerboard_kernel:Returns - -A 2D gaussian Kernel of length 2 * n + 1. - - -### compute_self_similarity - -Computes a self similarity matrix on the given sequence using the dot-product. -This function will utilize [``smooth_downsample_feature_sequence``](#smooth_downsample_feature_sequence) -and [``normalize_feature_sequence``](#normalize_feature_sequence) before the actual computation. -Edges and corners in the SSM represent transitions between segments. - -#### compute_self_similarity:Arguments - -- ``feature``: The feature sequence -- ``samplerate``: The samplerate of the feature sequence -- ``filter_len: int``: The length of the filter used for smoothing. Has to be odd (if even will be incremented). -- ``downsampling: int``: The downsampling factor. - -#### compute_self_similarity:Returns - -An SSM (Self similarity matrix) for the given feature vector. - - -### compute_novelty_ssm - -Computes a novelty function on the given SSM (Self Similarity Matrix) using -a given Corner detection kernel (or [create_gaussian_checkerboard_kernel](#create_gaussian_checkerboard_kernel) -by default). -The beginning and end of the resulting function will be inaccurate, since we mirror -the SSM for the convolution. These inaccurate parts may be excluded and set to 0. -This will result in a 1D representation of the SSM where peaks represent -transitions between segments. - -#### compute_novelty_ssm:Arguments - -- ``ssm``: The self similarity matrix to work with -- ``kernel``: The corner detection kernel to compute a novelty function with. -If None is specified, will default to [create_gaussian_checkerboard_kernel](#create_gaussian_checkerboard_kernel) -- ``n: int``: Influences the length of the default kernel -- ``var: float``: The variance of the default kernel -- ``exclude: bool``: Whether to exclude the first and last 2 * n + 1 values. -The edges of the ssm will be padded by reflection, which will result in inaccuracies. - -#### compute_novelty_ssm:Returns - -A novelty function of the given SSM - - -### select_peaks - -Finds the Indices of peaks in the given novelty function, -which represent transitions. -Indices are in audio frames and will be upsampled (if previously downsampled) -and incremented by a given offset. - -#### select_peaks:Arguments - -- ``novelty``: The novelty function -- ``peak_threshold: float``: The threshold by which peaks are selected. -See [Librosa Docs](https://librosa.org/doc/latest/generated/librosa.util.peak_pick.html#librosa.util.peak_pick) -- ``downsampling: int``: The downsampling factor by which the ssm was previously downsampled -- ``offset: float``: An offset to increment resulting peaks by. This is useful for streamed audio, since each block of -the stream starts at 0 - -#### select_peaks:Returns - -A list of peak indices (indices are audio frames, not samples). - - -### filter_peaks - -Filters a given vector to only include values that occur more than n (by default 3) -times. This may be necessary when working with overlapping block in a stream, where -the same peaks may appear multiple times. - -#### filter_peaks:Arguments - -- ``peaks``: The list of peak indices -- ``n: int``: The number of times a values has to appear, for it to be relevant. - -#### filter_peaks:Returns - -The filtered list of peak indices. - - -### segment_block - -Segments a block (see: [Librosa Docs](https://librosa.org/doc/latest/generated/librosa.stream.html#librosa.stream)). -This will extract a specified [``FeatureType``](#FeatureType) compute the SSM and Novelty Function -and finally search for Peaks. - -#### segment_block:Arguments - -- ``block``: A block of the streamed audio -- ``samplerate``: The samplerate of the audio -- ``hop_length: int``: The hop_length of the audio stream (amount of samples jumped between audio frames) -- ``feature: FeatureType``: The [``FeatureType``](#FeatureType) to use for segmentation -- ``filter_len: int``: The length of the smoothing filter. See [``smooth_downsample_feature_sequence``](#smooth_downsample_feature_sequence) -- ``downsampling: int``: The downsampling factor for the SSM. See [``smooth_downsample_feature_sequence``](#smooth_downsample_feature_sequence) -- ``threshold: float``: The peak threshold. See [``select_peaks``](#select_peaks) -- ``offset: float``: The offset by which peaks are incremented. See [``select_peaks``](#select_peaks) - -#### segment_block:Returns - -All peak indices found for the given block. - - -### segment_file - -Creates a generator, where each step results in a start_time and duration, representing a segment. -This will stream over the audio in overlapping blocks and segment each block individually. -The resulting peaks will be filtered, to make sure the peaks are not just local maximums, before being pairwise iterated. - -#### segment_file:Arguments - -- ``path``: The path to the audio file. -- ``preset: Preset``: The preset of values used in segmentation. - -#### segment_file:Returns - -A generator over each segment of the audio file. -Each segment consists of start_time, duration and samplerate. diff --git a/docs/backend/backend_module_docs/shazam.md b/docs/backend/backend_module_docs/shazam.md deleted file mode 100644 index d824be6..0000000 --- a/docs/backend/backend_module_docs/shazam.md +++ /dev/null @@ -1,160 +0,0 @@ -# Shazam - -This class provides functionality to access the [Shazam API](https://rapidapi.com/apidojo/api/shazam) to identify a segment of song data. - -Requests are performed using the Python ``requests`` library, so functions sending requests to the Shazam API may throw all exceptions the ``requests`` library can throw. - -## Contents - -Public functions: - -- [``lookup``](#lookup) - -Private functions: - -- [``_lookup_segment_with_offset``](#_lookup_segment_with_offset) -- [``_format_song_data``](#_format_song_data) -- [``_get_song_data_segment``](#_get_song_data_segment) -- [``_create_payload_from_song_data``](#_create_payload_from_song_data) -- [``_send_lookup_request``](#_send_lookup_request) -- [``_extract_value_from_metadata``](#_extract_value_from_metadata) - -## Public functions - -### lookup - -Attempt to identify the given song using the [Shazam API](https://rapidapi.com/apidojo/api/shazam). If the song can't be recognised from the first segment, step through it until the segment ends or a result is found. - -The step size is defined by the ``LOOKUP_OFFSET_INCREMENT`` constant and set to 10 seconds by default. The segment size is defined by the ``LOOKUP_SEGMENTS_DURATION`` constant and set to 4 seconds by default, as the [Shazam API](https://rapidapi.com/apidojo/api/shazam) expects segments between 3 and 5 seconds. - -#### lookup:Arguments - -- ``song_data: numpy.ndarray``: The song data. The data must be at a sample rate of 44100Hz as the [Shazam API](https://rapidapi.com/apidojo/api/shazam) will not work with other sample rates. -- ``apikey: str``: The Shazam API key. -- ``from_start: bool = True``: Whether to start attempting to identify segments of the given song from the beginning or the ending. - -#### lookup:Returns - -- If matches are found: The retrieved metadata as a ``dict``, with the keys ``"title"``, ``"artist"``, ``"album"`` and ``"year"`` for the respective metadata. -- ``None`` otherwise. - -Example: - -```python -{ - "title": "Thunderstruck", - "artist": "AC/DC", - "album": "The Razor's Edge", - "year": "1990" -} -``` - -#### lookup:Raises - -- ``requests.exceptions.RequestException`` if the request fails due to network problems, too many redirections or other problems. A detailed list of Exceptions ``requests``can raise can be found in [the ``requests`` documentation](https://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions) - -#### lookup:Example - -Load a song and load metadata for it using ``lookup``. - -```python -import librosa -import modules.apis.shazam - -song, sr = librosa.load("my_cool_file", sr=44100) -result = lookup(song, "MY-SHAZAM-API-KEY") - -print(result) -``` - -## Private functions - -While these functions aren't "private" in the sense that they cannot be accessed from the outside, they should not be called from outside this file. - -### _lookup_segment_with_offset - -Look up a snippet of the given song at the given offset. This function integrates functionality to create the payload required for a request, send the request to the [Shazam API](https://rapidapi.com/apidojo/api/shazam) and process the response. - -#### _lookup_segment_with_offset:Arguments - -- ``song_data: numpy.ndarray``: The song data. Must be at a sample rate of 44100Hz. -- ``apikey: str``: The API key. -- ``offset: int``: The offset the snippet should start at, in seconds. - -#### _lookup_segment_with_offset:Returns - -Tuple ``(matches, track)`` of the retrieved metadata, matching the sections of the API response with the same name. The format for the API response can be found using the test functionality on the [Shazam API](https://rapidapi.com/apidojo/api/shazam) website. - -#### _lookup_segment_with_offset:Raises - -- ``requests.exceptions.RequestException`` if the request fails due to network problems, too many redirections or other problems. A detailed list of Exceptions ``requests``can raise can be found in [the ``requests`` documentation](https://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions) - -### _format_song_data - -Format the song data as a mono 16-bit integer array, as the [Shazam API](https://rapidapi.com/apidojo/api/shazam) will not work with other formats. - -#### _format_song_data:Arguments - -- ``song_data: numpy.ndarray``: The song data. This is expected to be formatted as ``float``s between -1 and 1. - -#### _format_song_data:Returns - -``numpy.ndarray`` containing the formatted data. - -### _get_song_data_segment - -Extract a segment of the song data at the given offset. - -#### _get_song_data_segment:Arguments - -- ``song_data: numpy.ndarray``: The song data. -- ``offset: int``: The offset the snippet should start at, in seconds. - -#### _get_song_data_segment:Returns - -``numpy.ndarray`` containing the extracted segment. - -### _create_payload_from_song_data - -Create the payload to include with the request in the [Shazam API](https://rapidapi.com/apidojo/api/shazam)'s data format (A base64-encoded byte array). This expects that the song data has been formatted using [``format_song_data``](#_format_song_data) and that the song data is between 3-5 seconds. - -#### _create_payload_from_song_data:Arguments - -- ``song_data: numpy.ndarray``: The song data, formatted as a mono 16-bit integer array. - -#### _create_payload_from_song_data:Returns - -``str`` containing the payload. - -### _send_lookup_request - -Send the actual lookup request to the [Shazam API](https://rapidapi.com/apidojo/api/shazam). This uses the ``requests`` module to send the request and can thus throw all errors a failed ``requests.post()`` can. - -#### _send_lookup_request:Arguments - -- ``payload: str``: The payload as generated by [``_create_payload_from_song_data``](#_create_payload_from_song_data). -- ``apikey``: The Shazam API key. - -#### _send_lookup_request:Returns - -``requests.Response`` containing the request response. The format for the API response can be found using the test functionality at the [Shazam API](https://rapidapi.com/apidojo/api/shazam) website. - -#### _send_lookup_request:Raises - -- ``requests.exceptions.RequestException`` if the request fails due to network problems, too many redirections or other problems. A detailed list of Exceptions ``requests``can raise can be found in [the ``requests`` documentation](https://docs.python-requests.org/en/latest/user/quickstart/#errors-and-exceptions) - -### _extract_value_from_metadata - -Extract a value from the response's "Metadata" section. - -If an error occurs that leads to the "Metadata" section containing two sets of data with the same label, the first set of data is returned. - -#### _extract_value_from_metadata:Arguments - -- ``track: list``: The "track" segment of the API response. -- ``key: str``: The key to search for in the metadata. - -#### _extract_value_from_metadata:Returns - -- ``str`` containing the value if it exists. -- Empty ``str`` otherwise. diff --git a/docs/frontend/composables/useEnv.md b/docs/frontend/composables/useEnv.md new file mode 100644 index 0000000..8158390 --- /dev/null +++ b/docs/frontend/composables/useEnv.md @@ -0,0 +1,14 @@ +# useEnv +Provides a reactive object that wraps all environment variables needed for audio identification in the backend. Any changes made to this object will be immediately reflected in the `env` key of the localStorage. +## Returns +A reactive object representing the environment variables. +``` +() => RemovableRef<{ SERVICE_ACOUSTID_API_KEY: any; SERVICE_ACOUSTID_USER_KEY: any; SERVICE_SHAZAM_API_KEY: any; }> +``` +## Examples +```ts +const env = useEnv(); + +// Updating the SERVICE_API_KEY environment variable +env.SERVICE_API_KEY = 'somekey'; +``` \ No newline at end of file diff --git a/docs/frontend/composables/useSaveSetings.md b/docs/frontend/composables/useSaveSetings.md new file mode 100644 index 0000000..f343e2f --- /dev/null +++ b/docs/frontend/composables/useSaveSetings.md @@ -0,0 +1,14 @@ +# useSaveSetings +Provides a reactive object that wraps save settings. Any changes made to this object will be immediately reflected in the `save-settings` key of the localStorage. +## Returns +A reactive object representing audio identification settings. +``` +() => RemovableRef<{ fileType: string; shouldAsk: boolean; submitSavedFiles: boolean; saveDirectory: string; nameTemplate: string; }> +``` +## Examples +```ts +const saveSettings = useSaveSetings(); + +// Updating the fileType in audio identification settings +saveSettings.value.fileType = 'wav'; +``` \ No newline at end of file diff --git a/docs/generate_docs.py b/docs/generate_docs.py index 996af91..3384b52 100644 --- a/docs/generate_docs.py +++ b/docs/generate_docs.py @@ -8,7 +8,6 @@ def replace_dot_with_underscore(matchobj: re.Match): result = ( "(" + matchobj.group(1).replace(".", "_") - + ".md" + (matchobj.group(2) if matchobj.group(2) is not None else "") + ")" ) diff --git a/docs/public/logo.ico b/docs/public/logo.ico deleted file mode 100644 index 197323a..0000000 Binary files a/docs/public/logo.ico and /dev/null differ diff --git a/docs/public/logo.svg b/docs/public/logo.svg new file mode 100644 index 0000000..ee8d0e6 --- /dev/null +++ b/docs/public/logo.svg @@ -0,0 +1,8 @@ + + + + diff --git a/package-lock.json b/package-lock.json index de2c02e..6c8d64f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,36 +14,36 @@ "simple-git-hooks": "^2.9.0", "vue": "^3.3.4", "vue-final-modal": "^4.4.5", - "vue-i18n": "^9.3.0", - "vue-router": "^4.2.4", - "wavesurfer.js": "^7.2.2" + "vue-i18n": "^9.4.1", + "vue-router": "^4.2.5", + "wavesurfer.js": "^7.3.2" }, "devDependencies": { - "@antfu/eslint-config": "^0.41.0", + "@antfu/eslint-config": "^0.43.1", "@iconify-json/carbon": "^1.1.21", - "@intlify/unplugin-vue-i18n": "^1.0.1", - "@types/node": "^18.17.14", - "@unocss/eslint-config": "^0.55.7", - "@unocss/reset": "^0.55.7", - "@unocss/transformer-directives": "^0.55.7", - "@unocss/transformer-variant-group": "^0.55.7", + "@intlify/unplugin-vue-i18n": "^1.2.0", + "@types/node": "^18.17.19", + "@unocss/eslint-config": "^0.56.1", + "@unocss/reset": "^0.56.1", + "@unocss/transformer-directives": "^0.56.1", + "@unocss/transformer-variant-group": "^0.56.1", "@vitejs/plugin-vue": "^4.3.4", "@vue/test-utils": "^2.4.1", - "eslint": "^8.48.0", + "eslint": "^8.50.0", "jsdom": "^22.1.0", "orval": "^6.17.0", "taze": "^0.11.2", "tsdoc-markdown": "^0.1.0", "typescript": "^5.1.3", - "unocss": "^0.55.7", + "unocss": "^0.56.1", "unplugin-auto-import": "^0.16.6", "unplugin-vue-components": "^0.25.2", "vite": "^4.4.9", "vite-plugin-pages": "^0.31.0", - "vitepress": "^1.0.0-rc.13", - "vitest": "^0.34.4", + "vitepress": "^1.0.0-rc.20", + "vitest": "^0.34.5", "vue-docgen-cli": "^4.67.0", - "vue-tsc": "^1.8.10" + "vue-tsc": "^1.8.13" }, "engines": { "node": ">= 18.17.1", @@ -247,14 +247,14 @@ } }, "node_modules/@antfu/eslint-config": { - "version": "0.41.4", - "resolved": "https://registry.npmjs.org/@antfu/eslint-config/-/eslint-config-0.41.4.tgz", - "integrity": "sha512-1bPnXjrv3DqF4FsRgorJvCjGM5oB1fOYeAXAER/TLS7WXO1oD/9s/G39mBy9K7HxLLyFuLuZAw0h/Uz0GR1k9w==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@antfu/eslint-config/-/eslint-config-0.43.1.tgz", + "integrity": "sha512-kTOJeCqhotaiQ/Rv6JxgfAX+SxUq2GII4ZIvTa3GWBUXhFMBvehdUNtxcmO8/HxwxYKkm34/qeF+v7osBsMF1w==", "dev": true, "dependencies": { - "@antfu/eslint-config-vue": "0.41.4", - "@typescript-eslint/eslint-plugin": "^6.7.0", - "@typescript-eslint/parser": "^6.7.0", + "@antfu/eslint-config-vue": "0.43.1", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "@typescript-eslint/parser": "^6.7.2", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-html": "^7.1.0", "eslint-plugin-import": "npm:eslint-plugin-i@2.28.1", @@ -272,16 +272,17 @@ } }, "node_modules/@antfu/eslint-config-basic": { - "version": "0.41.4", - "resolved": "https://registry.npmjs.org/@antfu/eslint-config-basic/-/eslint-config-basic-0.41.4.tgz", - "integrity": "sha512-bdBC8tyJzTa4a883m50efVLRjiVX8lMAhvmFxvpue6ScBnPLqW+J3sJupolefp/Xc00VU8ThD3iOBCE8Ja9qfg==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@antfu/eslint-config-basic/-/eslint-config-basic-0.43.1.tgz", + "integrity": "sha512-SW6hmGmqI985fsCJ+oivo4MbiMmRMgCJ0Ne8j/hwCB6O6Mc0m5bDqYeKn5HqFhvZhG84GEg5jPDKNiHrBYnQjw==", "dev": true, "dependencies": { - "eslint-plugin-antfu": "0.41.4", + "@stylistic/eslint-plugin-js": "0.0.4", + "eslint-plugin-antfu": "0.43.1", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-html": "^7.1.0", "eslint-plugin-import": "npm:eslint-plugin-i@2.28.1", - "eslint-plugin-jsdoc": "^46.6.0", + "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-jsonc": "^2.9.0", "eslint-plugin-markdown": "^3.0.1", "eslint-plugin-n": "^16.1.0", @@ -298,15 +299,16 @@ } }, "node_modules/@antfu/eslint-config-ts": { - "version": "0.41.4", - "resolved": "https://registry.npmjs.org/@antfu/eslint-config-ts/-/eslint-config-ts-0.41.4.tgz", - "integrity": "sha512-YikIdwZwFPKEAL08GELjC0tzSaEKceINg8R4cwpvVlkXIaut9Tiyhgw69OBlfWdf3oMhpJ4ksy2WFfWh2qmjaw==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@antfu/eslint-config-ts/-/eslint-config-ts-0.43.1.tgz", + "integrity": "sha512-s3zItBSopYbM/3eii/JKas1PmWR+wCPRNS89qUi4zxPvpuIgN5mahkBvbsCiWacrNFtLxe1zGgo5qijBhVfuvA==", "dev": true, "dependencies": { - "@antfu/eslint-config-basic": "0.41.4", - "@typescript-eslint/eslint-plugin": "^6.7.0", - "@typescript-eslint/parser": "^6.7.0", - "eslint-plugin-jest": "^27.2.3" + "@antfu/eslint-config-basic": "0.43.1", + "@stylistic/eslint-plugin-ts": "0.0.4", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "@typescript-eslint/parser": "^6.7.2", + "eslint-plugin-jest": "^27.4.0" }, "peerDependencies": { "eslint": ">=7.4.0", @@ -314,13 +316,13 @@ } }, "node_modules/@antfu/eslint-config-vue": { - "version": "0.41.4", - "resolved": "https://registry.npmjs.org/@antfu/eslint-config-vue/-/eslint-config-vue-0.41.4.tgz", - "integrity": "sha512-tOZ4ria8wahZ4bn5Sglarcw+IPVn+QXNincjzB0tmwBzQP2XTM8fXYlvqO1VBA1/Jgr2BVGgZVXBHy1StDBTnA==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@antfu/eslint-config-vue/-/eslint-config-vue-0.43.1.tgz", + "integrity": "sha512-HxOfe8Vl+DPrzssbs5LHRDCnBtCy1LSA1DIeV71IC+iTpzoASFahSsVX5qckYu1InFgUm93XOhHCWm34LzPsvg==", "dev": true, "dependencies": { - "@antfu/eslint-config-basic": "0.41.4", - "@antfu/eslint-config-ts": "0.41.4", + "@antfu/eslint-config-basic": "0.43.1", + "@antfu/eslint-config-ts": "0.43.1", "eslint-plugin-vue": "^9.17.0", "local-pkg": "^0.4.3" }, @@ -659,21 +661,21 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.19", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.19.tgz", - "integrity": "sha512-Tinq7ybnEPFFXhlYOYFiSjespWQk0dq2dRNAiMdRTOYQzEGqnnNyrTxPYHP5r6wGjlF1rFgABdDV0g8EwD6Qbg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, @@ -1239,9 +1241,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", - "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", + "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1328,9 +1330,9 @@ "dev": true }, "node_modules/@iconify/utils": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-2.1.9.tgz", - "integrity": "sha512-mo+A4n3MwLlWlg1SoSO+Dt6pOPWKElk9sSJ6ZpuzbB9OcjxN8RUWxU3ulPwB1nglErWKRam2x4BAohbYF7FiFA==", + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-2.1.10.tgz", + "integrity": "sha512-0/+5hxjzCZ9RoYpqxnOzbnpQyMdZRuHcMxPJeuX+x/aZkAAD/N4TajDjAPT7LpX+M0bfLExj/p0bbDkUfp0lrg==", "dev": true, "dependencies": { "@antfu/install-pkg": "^0.1.1", @@ -2767,6 +2769,37 @@ "integrity": "sha512-sV+51I7WYnLJnKPn2EMWgS4EUfoP4iWEbrWwbXsj0MZCB/xOK8j6+C9fntIdOM50kpx45ZLC3s6kwKivWuqvyg==", "dev": true }, + "node_modules/@stylistic/eslint-plugin-js": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-0.0.4.tgz", + "integrity": "sha512-W1rq2xxlFNhgZZJO+L59wtvlDI0xARYxx0WD8EeWNBO7NDybUSYSozCIcY9XvxQbTAsEXBjwqokeYm0crt7RxQ==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0", + "escape-string-regexp": "^4.0.0", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esutils": "^2.0.3", + "graphemer": "^1.4.0" + } + }, + "node_modules/@stylistic/eslint-plugin-ts": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-0.0.4.tgz", + "integrity": "sha512-sWL4Km5j8S+TLyzya/3adxMWGkCm3lVasJIVQqhxVfwnlGkpMI0GgYVIu/ubdKPS+dSvqjUHpsXgqWfMRF2+cQ==", + "dev": true, + "dependencies": { + "@stylistic/eslint-plugin-js": "0.0.4", + "@typescript-eslint/scope-manager": "^6.7.0", + "@typescript-eslint/type-utils": "^6.7.0", + "@typescript-eslint/utils": "^6.7.0", + "graphemer": "^1.4.0" + }, + "peerDependencies": { + "eslint": "*", + "typescript": "*" + } + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -2867,6 +2900,22 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "node_modules/@types/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==", + "dev": true + }, + "node_modules/@types/markdown-it": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-13.0.1.tgz", + "integrity": "sha512-SUEb8Frsxs3D5Gg9xek6i6EG6XQ5s+O+ZdQzIPESZVZw3Pv3CPQfjCJBI+RgqZd1IBeu18S0Rn600qpPnEK37w==", + "dev": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, "node_modules/@types/mdast": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", @@ -2876,6 +2925,12 @@ "@types/unist": "^2" } }, + "node_modules/@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "dev": true + }, "node_modules/@types/ms": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", @@ -2883,15 +2938,15 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.17.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.16.tgz", - "integrity": "sha512-e0zgs7qe1XH/X3KEPnldfkD07LH9O1B9T31U8qoO7lqGSjj3/IrBuvqMeJ1aYejXRK3KOphIUDw6pLIplEW17A==", + "version": "18.17.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", + "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", "dev": true }, "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.2.tgz", + "integrity": "sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==", "dev": true }, "node_modules/@types/sarif": { @@ -2924,16 +2979,16 @@ "integrity": "sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.0.tgz", - "integrity": "sha512-gUqtknHm0TDs1LhY12K2NA3Rmlmp88jK9Tx8vGZMfHeNMLE3GH2e9TRub+y+SOjuYgtOmok+wt1AyDPZqxbNag==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz", + "integrity": "sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.0", - "@typescript-eslint/type-utils": "6.7.0", - "@typescript-eslint/utils": "6.7.0", - "@typescript-eslint/visitor-keys": "6.7.0", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/type-utils": "6.7.2", + "@typescript-eslint/utils": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2959,15 +3014,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.0.tgz", - "integrity": "sha512-jZKYwqNpNm5kzPVP5z1JXAuxjtl2uG+5NpaMocFPTNC2EdYIgbXIPImObOkhbONxtFTTdoZstLZefbaK+wXZng==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.2.tgz", + "integrity": "sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.7.0", - "@typescript-eslint/types": "6.7.0", - "@typescript-eslint/typescript-estree": "6.7.0", - "@typescript-eslint/visitor-keys": "6.7.0", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4" }, "engines": { @@ -2987,13 +3042,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz", - "integrity": "sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", + "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.0", - "@typescript-eslint/visitor-keys": "6.7.0" + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3004,13 +3059,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.0.tgz", - "integrity": "sha512-f/QabJgDAlpSz3qduCyQT0Fw7hHpmhOzY/Rv6zO3yO+HVIdPfIWhrQoAyG+uZVtWAIS85zAyzgAFfyEr+MgBpg==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz", + "integrity": "sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.0", - "@typescript-eslint/utils": "6.7.0", + "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/utils": "6.7.2", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -3031,9 +3086,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.0.tgz", - "integrity": "sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.2.tgz", + "integrity": "sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3044,13 +3099,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz", - "integrity": "sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz", + "integrity": "sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.0", - "@typescript-eslint/visitor-keys": "6.7.0", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3071,17 +3126,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.0.tgz", - "integrity": "sha512-MfCq3cM0vh2slSikQYqK2Gq52gvOhe57vD2RM3V4gQRZYX4rDPnKLu5p6cm89+LJiGlwEXU8hkYxhqqEC/V3qA==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.2.tgz", + "integrity": "sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.0", - "@typescript-eslint/types": "6.7.0", - "@typescript-eslint/typescript-estree": "6.7.0", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.2", "semver": "^7.5.4" }, "engines": { @@ -3096,12 +3151,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz", - "integrity": "sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", + "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.0", + "@typescript-eslint/types": "6.7.2", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3113,14 +3168,14 @@ } }, "node_modules/@unocss/astro": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/astro/-/astro-0.55.7.tgz", - "integrity": "sha512-mw8r14ArxUQBVCCisAJlF/WsZb650iBsduD/lXMk56N/nQ3MMArCcn62kcAxgZSb5tfIOQGQu/tbR8hEcD8y2g==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/astro/-/astro-0.56.1.tgz", + "integrity": "sha512-ivWm69J76DRwCiEFM75qR4WPMCC6nyOrUM5iQDTypwKbBX26XlXcYYCN3DLoQTmWdp5f2BubZXAg3KIdgVxrYg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", - "@unocss/reset": "0.55.7", - "@unocss/vite": "0.55.7" + "@unocss/core": "0.56.1", + "@unocss/reset": "0.56.1", + "@unocss/vite": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -3135,16 +3190,16 @@ } }, "node_modules/@unocss/cli": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/cli/-/cli-0.55.7.tgz", - "integrity": "sha512-ZHX2SR2WQbKfcmgOOHjBLB3V57Ct76Zb76YULzBj2EVX43lX/YDCVG87n6ePDY7rOcjCAthjrFQYCLV5KVLKHg==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/cli/-/cli-0.56.1.tgz", + "integrity": "sha512-s7lRtPkNw7GXdej3uYKFgfyal3Bq0Ux9oJKQ3rV7ysvY5AMfHs+ayc1EC6vXsAunziJ39dloPrRY5cx1H7abkQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", - "@rollup/pluginutils": "^5.0.3", - "@unocss/config": "0.55.7", - "@unocss/core": "0.55.7", - "@unocss/preset-uno": "0.55.7", + "@rollup/pluginutils": "^5.0.4", + "@unocss/config": "0.56.1", + "@unocss/core": "0.56.1", + "@unocss/preset-uno": "0.56.1", "cac": "^6.7.14", "chokidar": "^3.5.3", "colorette": "^2.0.20", @@ -3165,12 +3220,12 @@ } }, "node_modules/@unocss/config": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/config/-/config-0.55.7.tgz", - "integrity": "sha512-+X6rPScyFEWbkZyCyM+HfoJhJNN+CEl2n2izWkm0kuDj3w9fY9B3f/0dsk+jmx/gJEI5Y797q9zspNMNDib1AA==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/config/-/config-0.56.1.tgz", + "integrity": "sha512-ZwKWtbMfg38laUNwjERkiTo3JKCgpw+hZMBqbbr2N4Rhc1ZaT4EJyQmcc/+P05JoNNr+ueYMoCMOCOtn/wuheQ==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", + "@unocss/core": "0.56.1", "unconfig": "^0.3.10" }, "engines": { @@ -3181,21 +3236,21 @@ } }, "node_modules/@unocss/core": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/core/-/core-0.55.7.tgz", - "integrity": "sha512-c+bWe844Xjlwc1EPwHj0+n3LpntJG7ELPbEOOxNIG+CQdcEX0l1G0rkM8+nKstJ9WJmgpf1HdJQLVMF62HXvhw==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/core/-/core-0.56.1.tgz", + "integrity": "sha512-2qmb/+hQ2CXmIgSqaeL6Pw2reO2MxsZlLMFuu71J8T3+UKrkI9NAwkZ4sdb38EoOisVIr2lvE48uc44XBfaOdg==", "dev": true, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/eslint-config": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/eslint-config/-/eslint-config-0.55.7.tgz", - "integrity": "sha512-ykRUpPeT5kJSXHAduOJ2PxnEoaYsGOS2jG9iVjbbvER36ZQ+71xdwep/qpBlAr4LWLeoICy7Om+No1r43ZDntw==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/eslint-config/-/eslint-config-0.56.1.tgz", + "integrity": "sha512-ph1w2FO+wCHq0jz0iQyxUbjwLSVjSz6wQ2yd0fCsm6mHNlewWHmu6gD3Grs9j5XDyFJEwz4HZZRHspJanqSJyA==", "dev": true, "dependencies": { - "@unocss/eslint-plugin": "0.55.7" + "@unocss/eslint-plugin": "0.56.1" }, "engines": { "node": ">=14" @@ -3205,14 +3260,14 @@ } }, "node_modules/@unocss/eslint-plugin": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/eslint-plugin/-/eslint-plugin-0.55.7.tgz", - "integrity": "sha512-U+poFU/GJH8NvFBQxLp64zRRfnLWSbY41+Q8Vnlw/nP/tizZumO2lNJ+UBIGFLa1TwyMulFjru6CXt2uSFKtaA==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/eslint-plugin/-/eslint-plugin-0.56.1.tgz", + "integrity": "sha512-WLTybFXK9FJUMmEdUBa4Yj6uZx4qTCThGVej5Rn3XA+5f58zNmcSbipUG5oz16Z/QqYKP8iKhtg5zAQJMi0erg==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "^6.4.1", - "@unocss/config": "0.55.7", - "@unocss/core": "0.55.7", + "@typescript-eslint/utils": "^6.7.2", + "@unocss/config": "0.56.1", + "@unocss/core": "0.56.1", "magic-string": "^0.30.3", "synckit": "^0.8.5" }, @@ -3224,23 +3279,24 @@ } }, "node_modules/@unocss/extractor-arbitrary-variants": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/extractor-arbitrary-variants/-/extractor-arbitrary-variants-0.55.7.tgz", - "integrity": "sha512-imK2g/frlo5Ag0uVB+C/Psyo5+9AnqhoRAgYa6gyrQ/TJnrnwf+M3jFngU9evIMHw92vig1DGfPa2ZId901DwQ==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/extractor-arbitrary-variants/-/extractor-arbitrary-variants-0.56.1.tgz", + "integrity": "sha512-2vEcVwUTpC0yROjvKGjR3HSE8jaf1cwQqL+Ba5oP+Y4Vrjlf8hqvoSowgVT+wp/ecPH8z82xFNhS+XMOdgXpGA==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/inspector": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/inspector/-/inspector-0.55.7.tgz", - "integrity": "sha512-N0mjZozDDyqx8Mh6C/ZlMTlDzGiq22sXY/hPRX55Cf44WZI4W/ZWajqAAp42B+lw2MN0k1FYEMIAwn9n+xgq/g==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/inspector/-/inspector-0.56.1.tgz", + "integrity": "sha512-PJ3MEwOvUjLaiySPQQKlw0XgwpReNK7c+nDX0D8ZBmUyw3swSn8wSar2cCOLsKLRtKRRp4kz1brM/BaleyYyeg==", "dev": true, "dependencies": { + "@unocss/rule-utils": "0.56.1", "gzip-size": "^6.0.0", "sirv": "^2.0.3" }, @@ -3249,17 +3305,18 @@ } }, "node_modules/@unocss/postcss": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/postcss/-/postcss-0.55.7.tgz", - "integrity": "sha512-53Z/yv/CNdlTqKZQ9gpYRoLZSuzQ28J0SDrGCdzwjLcvHG/FD7/x1S7yxE7cUp/4sjvLL15HSzkWq8vNy6SkwQ==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/postcss/-/postcss-0.56.1.tgz", + "integrity": "sha512-8jUS5ynopvMbZmdUQhGv+lvKziuAPHHl9LaZzCJ4uHgPOwITNXWTi4dmNbytdYC3iYPQ++8eOph93VPCxdqVsw==", "dev": true, "dependencies": { - "@unocss/config": "0.55.7", - "@unocss/core": "0.55.7", + "@unocss/config": "0.56.1", + "@unocss/core": "0.56.1", + "@unocss/rule-utils": "0.56.1", "css-tree": "^2.3.1", "fast-glob": "^3.3.1", "magic-string": "^0.30.3", - "postcss": "^8.4.28" + "postcss": "^8.4.30" }, "engines": { "node": ">=14" @@ -3272,25 +3329,25 @@ } }, "node_modules/@unocss/preset-attributify": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-attributify/-/preset-attributify-0.55.7.tgz", - "integrity": "sha512-L1sNw3DyM4mymIm4DBTTTOllk8LmhYlWMgDlaAW2MYWygjqDCsp99wRKT2175Ya5xHYBA6XetMoBryZD23qJYQ==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-attributify/-/preset-attributify-0.56.1.tgz", + "integrity": "sha512-z+riyM9Fl+aYReg3cgxDRrI52teOL6ebj1UkMOje5sXuhneEQobUkg3k4Oi9NGTdalO5PU/jwcYCNfVksMPWZg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/preset-icons": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-icons/-/preset-icons-0.55.7.tgz", - "integrity": "sha512-JXLOHkyEKKAjLTqjAxYfhwln05WXilGg3jctkZWKpMNawPaonrGt3kZT12YMuMmOryxk7UcyKB0dtYc+p3QYvw==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-icons/-/preset-icons-0.56.1.tgz", + "integrity": "sha512-Jwyy7i39Hvt4gf+/vtlIcKucNP2y7IV5nF9KPuDnikho4xS/D24z3lbUclrscbH8XGfRcsUzGHI/y+8gD7zZjQ==", "dev": true, "dependencies": { - "@iconify/utils": "^2.1.9", - "@unocss/core": "0.55.7", + "@iconify/utils": "^2.1.10", + "@unocss/core": "0.56.1", "ofetch": "^1.3.3" }, "funding": { @@ -3298,61 +3355,63 @@ } }, "node_modules/@unocss/preset-mini": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-mini/-/preset-mini-0.55.7.tgz", - "integrity": "sha512-ZCskE2uprjGkpQezEPM6KPMf84rIZEUNc1p2DxWVHaFUPRV24/JSNsO4PsKrQgNIb2dLQxzPNlMzQJI7ssdBXQ==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-mini/-/preset-mini-0.56.1.tgz", + "integrity": "sha512-hOujmUN5kiA7KCkH1mUFf3cStsa3WZTi3g/I91VQ8EM4S6R7aRvME7LBXlb38z68+pckoDLhOhbN7gSg2iZTjA==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", - "@unocss/extractor-arbitrary-variants": "0.55.7" + "@unocss/core": "0.56.1", + "@unocss/extractor-arbitrary-variants": "0.56.1", + "@unocss/rule-utils": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/preset-tagify": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-tagify/-/preset-tagify-0.55.7.tgz", - "integrity": "sha512-aDsuN3a/ZirbCDKpFsue9tc8MHs3l0Rl81n2ZOdIrJoZW4YWyydMVl++cz/HERZW81ZySK8EJKwGBaMJMgsnHA==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-tagify/-/preset-tagify-0.56.1.tgz", + "integrity": "sha512-cd1McbaEpoerduOt8dA6MOkVZQIutuF3dHyjrI/pXbDtoyzBWjT9MLEeV77Hlz3S09+9cqGZddBBkqo0WGsM0w==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/preset-typography": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-typography/-/preset-typography-0.55.7.tgz", - "integrity": "sha512-hLV4nsgsDIk66pt7Ej4NYUmaGtI2EfGb1h2yl5FmBtdtACrgPq+Skr2Br9Iq+Bj1QFhbsMOWLDdbojFQwBdH6A==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-typography/-/preset-typography-0.56.1.tgz", + "integrity": "sha512-3p+dWEtMDe8MSPbUZseS94OpdYbv/pMTs2K1NBysE5BjIEVlyxRNWcZ8FC6risAJ1U0Ouctb6BqP6IA8r9BiWQ==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", - "@unocss/preset-mini": "0.55.7" + "@unocss/core": "0.56.1", + "@unocss/preset-mini": "0.56.1" } }, "node_modules/@unocss/preset-uno": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-uno/-/preset-uno-0.55.7.tgz", - "integrity": "sha512-z4pCxOv/OU1ARo++cvbijWNW2zy/EVTMqJXa+SEep9b99wFXPQE3gaPvLdURp/e5f1PoxVyPZ6JiBknbClSDuA==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-uno/-/preset-uno-0.56.1.tgz", + "integrity": "sha512-rNnjpmnfrP/1P462dyELBQHe5NDlFSrJevwjCpAOeFXdO0XCCULpHokuaovZYwesNvzzWu+cZequya38n5hkSw==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", - "@unocss/preset-mini": "0.55.7", - "@unocss/preset-wind": "0.55.7" + "@unocss/core": "0.56.1", + "@unocss/preset-mini": "0.56.1", + "@unocss/preset-wind": "0.56.1", + "@unocss/rule-utils": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/preset-web-fonts": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-web-fonts/-/preset-web-fonts-0.55.7.tgz", - "integrity": "sha512-ygAz0540kdBapErW2BcObWfQT/6g0SpVUPYg92PPiZD57CZAvuNXiYTfFMRXd88QrBL1zIrZ6NrzY0NZ645H+w==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-web-fonts/-/preset-web-fonts-0.56.1.tgz", + "integrity": "sha512-SO2ZjrcFSi02QgQT3UVUtIlZE59A92gB1pzmYTMGZhjhmxqq6aghvBKEC00LfnQ200MRtAawgiZ+5Xysi/XsGg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", + "@unocss/core": "0.56.1", "ofetch": "^1.3.3" }, "funding": { @@ -3360,104 +3419,121 @@ } }, "node_modules/@unocss/preset-wind": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/preset-wind/-/preset-wind-0.55.7.tgz", - "integrity": "sha512-vLi0mtYDnvx3uYtBR4fSCR52T59drTUp3XVAAqQTbhvRctnSWm65MWE4G+gqdt2qQ9fM4SVCsxLLaXuJkI2eqw==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/preset-wind/-/preset-wind-0.56.1.tgz", + "integrity": "sha512-/fR0eYlmezu6R3wWvN5zVNAfOE6rcC1CsEZKH0SdwchMvNDjJNd0rmAechI2BnVBaa3++H2Cz+0AfCDEP8tsjg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", - "@unocss/preset-mini": "0.55.7" + "@unocss/core": "0.56.1", + "@unocss/preset-mini": "0.56.1", + "@unocss/rule-utils": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/reset": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/reset/-/reset-0.55.7.tgz", - "integrity": "sha512-yvmLhxqUNgf6wue7IvhV/FdrQW9H9LF1Bmmhwwaiz2aV0E74aN4pbuYPZwNq3YafsQvNQ0UdtuXjddY4QMRCPw==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/reset/-/reset-0.56.1.tgz", + "integrity": "sha512-nfzLKv2W9Y3fZLny6lYTroa/YExczGYHsVPCBPGkVt0TrM0yDA+ZKOHbN93b5myY9hzJ3pHTEQmYFsFwzzr6Kg==", "dev": true, "funding": { "url": "https://github.com/sponsors/antfu" } }, + "node_modules/@unocss/rule-utils": { + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/rule-utils/-/rule-utils-0.56.1.tgz", + "integrity": "sha512-mmmbx10eELAyhYZqBWlQFPOafnL1hHp2fo18rUbZLedvMJWds3Z23Q/u3VKEpJnCszNkr03BXVwscR5+ZdF4uw==", + "dev": true, + "dependencies": { + "@unocss/core": "^0.56.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/@unocss/scope": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/scope/-/scope-0.55.7.tgz", - "integrity": "sha512-r0CaS1aSpcC37ztqOJ3qaWIzM6zwdlX8r0rib2vTvWTckw1J0ocVhjNkWRBM9kRWte006JhecdiZzXNHA40akg==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/scope/-/scope-0.56.1.tgz", + "integrity": "sha512-qIq/JuibrVOAJw/TCUm54XwHRcDImgrb1abZVuaicFh6fjmpdOi/iglYxoFqXS5gusp0m2vNnOLbaBB4LrPf5Q==", "dev": true }, "node_modules/@unocss/transformer-attributify-jsx": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/transformer-attributify-jsx/-/transformer-attributify-jsx-0.55.7.tgz", - "integrity": "sha512-ZyUBc0wguBhd+nbIlcrSYpmzKtqBi+8BII8SK4lIB/Ol1wBboByPTjBENsQkxRyffp5K9VTuZZ/LamFgPGOWDg==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/transformer-attributify-jsx/-/transformer-attributify-jsx-0.56.1.tgz", + "integrity": "sha512-2dQ7immRBnZJQ9aU+VIiAbcFCycXq8yXG2RPd82Pl0tAV8f5DtLbbuTC5mzo5lGOhuXJ+/u+IpuL9xchjOV7WQ==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/transformer-attributify-jsx-babel": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/transformer-attributify-jsx-babel/-/transformer-attributify-jsx-babel-0.55.7.tgz", - "integrity": "sha512-xl5K/Zg7tLyI6Oee+xHgvBm0gSEviYdBDwaGC4O6cP9VXTBm6waz9NUU6CmmVYKh4dSeLQ1PKNboMeg2nFuJMw==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/transformer-attributify-jsx-babel/-/transformer-attributify-jsx-babel-0.56.1.tgz", + "integrity": "sha512-8+l4tfifHiSnga3iaxqXfAMgEJG7yLphKPDSm6DHEMUqKeia9rn3V/bABx5KZxpMmnH6FoiYboJL4uf5W58a5Q==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/transformer-compile-class": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/transformer-compile-class/-/transformer-compile-class-0.55.7.tgz", - "integrity": "sha512-tiYiT9EG4ucSBvMo+9Hv43GY0YvXQjfQCXDhDm3tcJyreMg6BRMO412eir54RBS+JAdNU0DUoITVYu+PkF7hLg==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/transformer-compile-class/-/transformer-compile-class-0.56.1.tgz", + "integrity": "sha512-v3ICzTWj3oQ1S6qkGzg/oyzrk05ZgdcvjYFSZlgBIu2iUJldBhO0+7ZMuDpniaT21GjJvukLwiWrOF4mYyJCyg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/transformer-directives": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/transformer-directives/-/transformer-directives-0.55.7.tgz", - "integrity": "sha512-xNmR40FssHWYJSmJv/9TQC2IdTyZPV8U3Iv/PIuke1zndMwMciclghEFiw0wSeRmhoRI7iFZck5EI/Bokyo7CQ==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/transformer-directives/-/transformer-directives-0.56.1.tgz", + "integrity": "sha512-Pwh+JUxxn8ECqpEWETeD38OON5Y2oYAOC1CFKAyXoK22J7f51THoS07z2rZpDNdQA2T/szxenNCdRt72/NJ/pg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7", + "@unocss/core": "0.56.1", + "@unocss/rule-utils": "0.56.1", "css-tree": "^2.3.1" } }, "node_modules/@unocss/transformer-variant-group": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/transformer-variant-group/-/transformer-variant-group-0.55.7.tgz", - "integrity": "sha512-uLyZ08XXVriUDenZCTGA3xGgMD3B9GVr6mSz002pDlLpQDi8FcMQTOGg8X4ViCGzS3l03S/+r+JY7kJTpMFa9w==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/transformer-variant-group/-/transformer-variant-group-0.56.1.tgz", + "integrity": "sha512-UwXNcW00R6MjHZajy8lmSfwWDwhnvd+rF9eRGfcJTEzWr+LtEmgw8SJBr7STCB4ZwRE37NIp4oLLl1jF8omGNg==", "dev": true, "dependencies": { - "@unocss/core": "0.55.7" + "@unocss/core": "0.56.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@unocss/vite": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/@unocss/vite/-/vite-0.55.7.tgz", - "integrity": "sha512-xmdyDnt9Ag4o7DGl22/P6MaB+HSjWOQw9qYYzIefSv3SVUvn3cEhIX/PCWqFp8Kts2HyvAoJLbZmygSf1XdZNQ==", + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/@unocss/vite/-/vite-0.56.1.tgz", + "integrity": "sha512-IztLc304zP2LYQMsP3yVHmLwXlLUgCY3q6Nkqw6Hpds7l5JXBsE7Q19DtNW+4nDOp9wvWhw7CjQLmoh8d+V0lQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", - "@rollup/pluginutils": "^5.0.3", - "@unocss/config": "0.55.7", - "@unocss/core": "0.55.7", - "@unocss/inspector": "0.55.7", - "@unocss/scope": "0.55.7", - "@unocss/transformer-directives": "0.55.7", + "@rollup/pluginutils": "^5.0.4", + "@unocss/config": "0.56.1", + "@unocss/core": "0.56.1", + "@unocss/inspector": "0.56.1", + "@unocss/scope": "0.56.1", + "@unocss/transformer-directives": "0.56.1", "chokidar": "^3.5.3", "fast-glob": "^3.3.1", "magic-string": "^0.30.3" @@ -3483,13 +3559,13 @@ } }, "node_modules/@vitest/expect": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.4.tgz", - "integrity": "sha512-XlMKX8HyYUqB8dsY8Xxrc64J2Qs9pKMt2Z8vFTL4mBWXJsg4yoALHzJfDWi8h5nkO4Zua4zjqtapQ/IluVkSnA==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.5.tgz", + "integrity": "sha512-/3RBIV9XEH+nRpRMqDJBufKIOQaYUH2X6bt0rKSCW0MfKhXFLYsR5ivHifeajRSTsln0FwJbitxLKHSQz/Xwkw==", "dev": true, "dependencies": { - "@vitest/spy": "0.34.4", - "@vitest/utils": "0.34.4", + "@vitest/spy": "0.34.5", + "@vitest/utils": "0.34.5", "chai": "^4.3.7" }, "funding": { @@ -3497,12 +3573,12 @@ } }, "node_modules/@vitest/runner": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.4.tgz", - "integrity": "sha512-hwwdB1StERqUls8oV8YcpmTIpVeJMe4WgYuDongVzixl5hlYLT2G8afhcdADeDeqCaAmZcSgLTLtqkjPQF7x+w==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.5.tgz", + "integrity": "sha512-RDEE3ViVvl7jFSCbnBRyYuu23XxmvRTSZWW6W4M7eC5dOsK75d5LIf6uhE5Fqf809DQ1+9ICZZNxhIolWHU4og==", "dev": true, "dependencies": { - "@vitest/utils": "0.34.4", + "@vitest/utils": "0.34.5", "p-limit": "^4.0.0", "pathe": "^1.1.1" }, @@ -3538,9 +3614,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.4.tgz", - "integrity": "sha512-GCsh4coc3YUSL/o+BPUo7lHQbzpdttTxL6f4q0jRx2qVGoYz/cyTRDJHbnwks6TILi6560bVWoBpYC10PuTLHw==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.5.tgz", + "integrity": "sha512-+ikwSbhu6z2yOdtKmk/aeoDZ9QPm2g/ZO5rXT58RR9Vmu/kB2MamyDSx77dctqdZfP3Diqv4mbc/yw2kPT8rmA==", "dev": true, "dependencies": { "magic-string": "^0.30.1", @@ -3552,9 +3628,9 @@ } }, "node_modules/@vitest/spy": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.4.tgz", - "integrity": "sha512-PNU+fd7DUPgA3Ya924b1qKuQkonAW6hL7YUjkON3wmBwSTIlhOSpy04SJ0NrRsEbrXgMMj6Morh04BMf8k+w0g==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.5.tgz", + "integrity": "sha512-epsicsfhvBjRjCMOC/3k00mP/TBGQy8/P0DxOFiWyLt55gnZ99dqCfCiAsKO17BWVjn4eZRIjKvcqNmSz8gvmg==", "dev": true, "dependencies": { "tinyspy": "^2.1.1" @@ -3564,9 +3640,9 @@ } }, "node_modules/@vitest/utils": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.4.tgz", - "integrity": "sha512-yR2+5CHhp/K4ySY0Qtd+CAL9f5Yh1aXrKfAT42bq6CtlGPh92jIDDDSg7ydlRow1CP+dys4TrOrbELOyNInHSg==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.5.tgz", + "integrity": "sha512-ur6CmmYQoeHMwmGb0v+qwkwN3yopZuZyf4xt1DBBSGBed8Hf9Gmbm/5dEWqgpLPdRx6Av6jcWXrjcKfkTzg/pw==", "dev": true, "dependencies": { "diff-sequences": "^29.4.3", @@ -3656,9 +3732,9 @@ "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" }, "node_modules/@vue/language-core": { - "version": "1.8.11", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.11.tgz", - "integrity": "sha512-+MZOBGqGwfld6hpo0DB47x8eNM0dNqk15ZdfOhj19CpvuYuOWCeVdOEGZunKDyo3QLkTn3kLOSysJzg7FDOQBA==", + "version": "1.8.13", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.13.tgz", + "integrity": "sha512-nata2fYBZAkl4QJrU+IcArJCMTHt1VP8ePL/Z7eUPC2AF+Cm7Qgo9ksNCPBzZRh1LYjCaSaqV7njqNogwpsMVg==", "dev": true, "dependencies": { "@volar/language-core": "~1.10.0", @@ -3779,13 +3855,13 @@ } }, "node_modules/@vue/typescript": { - "version": "1.8.11", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.11.tgz", - "integrity": "sha512-skUmMDiPUUtu1flPmf2YybF+PX8IzBtMioQOaNn6Ck/RhdrPJGj1AX/7s3Buf9G6ln+/KHR1XQuti/FFxw5XVA==", + "version": "1.8.13", + "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.13.tgz", + "integrity": "sha512-ALJjHFqQ3dgZVCI/ogAS/dZ7JEhIi1N0Em5I7uwabY1p9RDRK3odLsycMHyxZRjm5dLI15c07eeBloHiD2Otlg==", "dev": true, "dependencies": { "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.11" + "@vue/language-core": "1.8.13" } }, "node_modules/@vueuse/core": { @@ -6060,15 +6136,15 @@ } }, "node_modules/eslint": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", - "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", + "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.49.0", + "@eslint/js": "8.50.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -6160,12 +6236,12 @@ } }, "node_modules/eslint-plugin-antfu": { - "version": "0.41.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-antfu/-/eslint-plugin-antfu-0.41.4.tgz", - "integrity": "sha512-naDIFqCW/7vFIz/TZNuapLEjGd8XoWFot0h8SStbqUIcdXFKc0MgDXCKtHQIyJp6plkKiucOW3gZJ0jjYrc3Qg==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-antfu/-/eslint-plugin-antfu-0.43.1.tgz", + "integrity": "sha512-Nak+Qpy5qEK10dCXtVaabPTUmLBPLhsVKAFXAtxYGYRlY/SuuZUBhW2YIsLsixNROiICGuov8sN+eNOCC7Wb5g==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "^6.7.0" + "@typescript-eslint/utils": "^6.7.2" } }, "node_modules/eslint-plugin-es-x": { @@ -6273,9 +6349,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.2.3.tgz", - "integrity": "sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==", + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.4.0.tgz", + "integrity": "sha512-ukVeKmMPAUA5SWjHenvyyXnirKfHKMdOsTZdn5tZx5EW05HGVQwBohigjFZGGj3zuv1cV6hc82FvWv6LdIbkgg==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" @@ -6420,9 +6496,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "46.8.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.1.tgz", - "integrity": "sha512-uTce7IBluPKXIQMWJkIwFsI1gv7sZRmLjctca2K5DIxPi8fSBj9f4iru42XmGwuiMyH2f3nfc60sFmnSGv4Z/A==", + "version": "46.8.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz", + "integrity": "sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.40.1", @@ -7216,9 +7292,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.0.tgz", - "integrity": "sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", "dev": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" @@ -10605,9 +10681,9 @@ } }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", + "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", "funding": [ { "type": "opencollective", @@ -12956,31 +13032,31 @@ } }, "node_modules/unocss": { - "version": "0.55.7", - "resolved": "https://registry.npmjs.org/unocss/-/unocss-0.55.7.tgz", - "integrity": "sha512-3W9P7vj2EhSk/4oPCHBS0VgrwSf5zZL6Az1/XARVOpBnRJtCM2szFInYxHkMgt9pkZTsW8SFCuk/g+QIJ6A8tg==", - "dev": true, - "dependencies": { - "@unocss/astro": "0.55.7", - "@unocss/cli": "0.55.7", - "@unocss/core": "0.55.7", - "@unocss/extractor-arbitrary-variants": "0.55.7", - "@unocss/postcss": "0.55.7", - "@unocss/preset-attributify": "0.55.7", - "@unocss/preset-icons": "0.55.7", - "@unocss/preset-mini": "0.55.7", - "@unocss/preset-tagify": "0.55.7", - "@unocss/preset-typography": "0.55.7", - "@unocss/preset-uno": "0.55.7", - "@unocss/preset-web-fonts": "0.55.7", - "@unocss/preset-wind": "0.55.7", - "@unocss/reset": "0.55.7", - "@unocss/transformer-attributify-jsx": "0.55.7", - "@unocss/transformer-attributify-jsx-babel": "0.55.7", - "@unocss/transformer-compile-class": "0.55.7", - "@unocss/transformer-directives": "0.55.7", - "@unocss/transformer-variant-group": "0.55.7", - "@unocss/vite": "0.55.7" + "version": "0.56.1", + "resolved": "https://registry.npmjs.org/unocss/-/unocss-0.56.1.tgz", + "integrity": "sha512-jjkcyXfW90CUjN4tBV6SrHX9ifi5GQgcwAQlMRB0copJEW3ejM/nyZnRgNexaV7hi7Ao76XMVqCKbOC5B+IuOA==", + "dev": true, + "dependencies": { + "@unocss/astro": "0.56.1", + "@unocss/cli": "0.56.1", + "@unocss/core": "0.56.1", + "@unocss/extractor-arbitrary-variants": "0.56.1", + "@unocss/postcss": "0.56.1", + "@unocss/preset-attributify": "0.56.1", + "@unocss/preset-icons": "0.56.1", + "@unocss/preset-mini": "0.56.1", + "@unocss/preset-tagify": "0.56.1", + "@unocss/preset-typography": "0.56.1", + "@unocss/preset-uno": "0.56.1", + "@unocss/preset-web-fonts": "0.56.1", + "@unocss/preset-wind": "0.56.1", + "@unocss/reset": "0.56.1", + "@unocss/transformer-attributify-jsx": "0.56.1", + "@unocss/transformer-attributify-jsx-babel": "0.56.1", + "@unocss/transformer-compile-class": "0.56.1", + "@unocss/transformer-directives": "0.56.1", + "@unocss/transformer-variant-group": "0.56.1", + "@unocss/vite": "0.56.1" }, "engines": { "node": ">=14" @@ -12989,7 +13065,7 @@ "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { - "@unocss/webpack": "0.55.7", + "@unocss/webpack": "0.56.1", "vite": "^2.9.0 || ^3.0.0-0 || ^4.0.0" }, "peerDependenciesMeta": { @@ -13284,9 +13360,9 @@ } }, "node_modules/vite-node": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.4.tgz", - "integrity": "sha512-ho8HtiLc+nsmbwZMw8SlghESEE3KxJNp04F/jPUCLVvaURwt0d+r9LxEqCX5hvrrOQ0GSyxbYr5ZfRYhQ0yVKQ==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.5.tgz", + "integrity": "sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -13294,7 +13370,7 @@ "mlly": "^1.4.0", "pathe": "^1.1.1", "picocolors": "^1.0.0", - "vite": "^3.0.0 || ^4.0.0" + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" @@ -13418,13 +13494,14 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.13", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.13.tgz", - "integrity": "sha512-TnVydQOZE38rtXu9gHCb7EGdN03jTcmYkDdhCqox6+pfKYgiyfm1qk2Uy8BZatnM9wXpa64f+T5p30R8P/9Z+A==", + "version": "1.0.0-rc.20", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.20.tgz", + "integrity": "sha512-CykMUJ8JLxLcGWek0ew3wln4RYbsOd1+0YzXITTpajggpynm2S331TNkJVOkHrMRc6GYe3y4pS40GfgcW0ZwAw==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", "@docsearch/js": "^3.5.2", + "@types/markdown-it": "^13.0.1", "@vue/devtools-api": "^6.5.0", "@vueuse/core": "^10.4.1", "@vueuse/integrations": "^10.4.1", @@ -13437,22 +13514,34 @@ }, "bin": { "vitepress": "bin/vitepress.js" + }, + "peerDependencies": { + "markdown-it-mathjax3": "^4.3.2", + "postcss": "^8.4.30" + }, + "peerDependenciesMeta": { + "markdown-it-mathjax3": { + "optional": true + }, + "postcss": { + "optional": true + } } }, "node_modules/vitest": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.4.tgz", - "integrity": "sha512-SE/laOsB6995QlbSE6BtkpXDeVNLJc1u2LHRG/OpnN4RsRzM3GQm4nm3PQCK5OBtrsUqnhzLdnT7se3aeNGdlw==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.5.tgz", + "integrity": "sha512-CPI68mmnr2DThSB3frSuE5RLm9wo5wU4fbDrDwWQQB1CWgq9jQVoQwnQSzYAjdoBOPoH2UtXpOgHVge/uScfZg==", "dev": true, "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.34.4", - "@vitest/runner": "0.34.4", - "@vitest/snapshot": "0.34.4", - "@vitest/spy": "0.34.4", - "@vitest/utils": "0.34.4", + "@vitest/expect": "0.34.5", + "@vitest/runner": "0.34.5", + "@vitest/snapshot": "0.34.5", + "@vitest/spy": "0.34.5", + "@vitest/utils": "0.34.5", "acorn": "^8.9.0", "acorn-walk": "^8.2.0", "cac": "^6.7.14", @@ -13467,7 +13556,7 @@ "tinybench": "^2.5.0", "tinypool": "^0.7.0", "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", - "vite-node": "0.34.4", + "vite-node": "0.34.5", "why-is-node-running": "^2.2.2" }, "bin": { @@ -13861,9 +13950,9 @@ } }, "node_modules/vue-router": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.4.tgz", - "integrity": "sha512-9PISkmaCO02OzPVOMq2w82ilty6+xJmQrarYZDkjZBfl4RvYAlt4PKnEX21oW4KTtWfa9OuO/b3qk1Od3AEdCQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz", + "integrity": "sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==", "dependencies": { "@vue/devtools-api": "^6.5.0" }, @@ -13885,13 +13974,13 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.11", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.11.tgz", - "integrity": "sha512-BzfiMdPqDHBlysx4g26NkfVHSQwGD/lTRausmxN9sFyjXz34OWfsbkh0YsVkX84Hu65In1fFlxHiG39Tr4Vojg==", + "version": "1.8.13", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.13.tgz", + "integrity": "sha512-Hl8zUXPVK2KzPtbXeMCN0CSFkwvD96YOtYt9KvJPG9W8QGcNpGk9KHwPuGMxA8blWXSIli7gtsoC+clICEVdVg==", "dev": true, "dependencies": { - "@vue/language-core": "1.8.11", - "@vue/typescript": "1.8.11", + "@vue/language-core": "1.8.13", + "@vue/typescript": "1.8.13", "semver": "^7.3.8" }, "bin": { diff --git a/package.json b/package.json index 81bcf3d..e270f33 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "vite": "vite -c src/frontend/vite.config.ts", "typecheck": "vue-tsc -p src/frontend --noEmit", "orval": "orval --config src/frontend/orval.config.ts", - "up": "taze major -I", + "deps:up:fe": "taze major -I", "docs:gen:be": "python3 docs/generate_docs.py", "docs:gen:fe": "vue-docgen -c src/frontend/docgen.config.js", "docs:gen": "npm run docs:gen:be && npm run docs:gen:fe", @@ -37,36 +37,36 @@ "simple-git-hooks": "^2.9.0", "vue": "^3.3.4", "vue-final-modal": "^4.4.5", - "vue-i18n": "^9.3.0", - "vue-router": "^4.2.4", - "wavesurfer.js": "^7.2.2" + "vue-i18n": "^9.4.1", + "vue-router": "^4.2.5", + "wavesurfer.js": "^7.3.2" }, "devDependencies": { - "@antfu/eslint-config": "^0.41.0", + "@antfu/eslint-config": "^0.43.1", "@iconify-json/carbon": "^1.1.21", - "@intlify/unplugin-vue-i18n": "^1.0.1", - "@types/node": "^18.17.14", - "@unocss/eslint-config": "^0.55.7", - "@unocss/reset": "^0.55.7", - "@unocss/transformer-directives": "^0.55.7", - "@unocss/transformer-variant-group": "^0.55.7", + "@intlify/unplugin-vue-i18n": "^1.2.0", + "@types/node": "^18.17.19", + "@unocss/eslint-config": "^0.56.1", + "@unocss/reset": "^0.56.1", + "@unocss/transformer-directives": "^0.56.1", + "@unocss/transformer-variant-group": "^0.56.1", "@vitejs/plugin-vue": "^4.3.4", "@vue/test-utils": "^2.4.1", - "eslint": "^8.48.0", + "eslint": "^8.50.0", "jsdom": "^22.1.0", "orval": "^6.17.0", "taze": "^0.11.2", "tsdoc-markdown": "^0.1.0", "typescript": "^5.1.3", - "unocss": "^0.55.7", + "unocss": "^0.56.1", "unplugin-auto-import": "^0.16.6", "unplugin-vue-components": "^0.25.2", "vite": "^4.4.9", "vite-plugin-pages": "^0.31.0", - "vitepress": "^1.0.0-rc.13", - "vitest": "^0.34.4", + "vitepress": "^1.0.0-rc.20", + "vitest": "^0.34.5", "vue-docgen-cli": "^4.67.0", - "vue-tsc": "^1.8.10" + "vue-tsc": "^1.8.13" }, "simple-git-hooks": { "pre-commit": "npx lint-staged" diff --git a/src/frontend/components/SettingsAdvanced.vue b/src/frontend/components/SettingsAdvanced.vue index 4e18f98..add526c 100644 --- a/src/frontend/components/SettingsAdvanced.vue +++ b/src/frontend/components/SettingsAdvanced.vue @@ -36,12 +36,12 @@ async function setApiKey(key: EnvKey) {
-
+
{{ t('settings.advanced.acoustid_api_key') }} -

+

{{ t('settings.advanced.hint.acoustid_api_key') }}

@@ -56,11 +56,11 @@ async function setApiKey(key: EnvKey) {
-
+
{{ t('settings.advanced.acoustid_user_key') }} -

+

{{ t('settings.advanced.hint.acoustid_user_key') }}

@@ -75,11 +75,11 @@ async function setApiKey(key: EnvKey) {
-
+
{{ t('settings.advanced.shazam_api_key') }} -

+

{{ t('settings.advanced.hint.shazam_api_key') }}

diff --git a/src/frontend/components/SettingsGeneral.vue b/src/frontend/components/SettingsGeneral.vue index 903dc99..1f2edf0 100644 --- a/src/frontend/components/SettingsGeneral.vue +++ b/src/frontend/components/SettingsGeneral.vue @@ -19,9 +19,9 @@ const { isDark } = useDarkToggle()
-
+

{{ t('settings.general.language') }}

-

+

{{ t('settings.general.hint.language') }}

@@ -34,9 +34,9 @@ const { isDark } = useDarkToggle()
-
+

{{ t('settings.general.darkmode') }}

-

+

{{ t('settings.general.hint.darkmode') }}

diff --git a/src/frontend/components/SettingsSave.vue b/src/frontend/components/SettingsSave.vue index 138acdc..c383d44 100644 --- a/src/frontend/components/SettingsSave.vue +++ b/src/frontend/components/SettingsSave.vue @@ -15,11 +15,11 @@ const settings = useSaveSetings()
-
+

{{ t('settings.save.file_type') }}

-

+

{{ t('settings.save.hint.file_type') }}

@@ -32,9 +32,9 @@ const settings = useSaveSetings()
-
+

{{ t('settings.save.ask_file_type') }}

-

+

{{ t('settings.save.hint.ask_file_type') }}

@@ -43,9 +43,9 @@ const settings = useSaveSetings()
-
+

{{ t('settings.save.submit_saved_files') }}

-

+

{{ t('settings.save.hint.submit_saved_files') }}

@@ -54,11 +54,11 @@ const settings = useSaveSetings()
-
+
{{ t('settings.save.save_directory') }} -

+

{{ t('settings.save.hint.save_directory') }}

@@ -67,11 +67,11 @@ const settings = useSaveSetings()
-
+
{{ t('settings.save.output_file_name') }} -

+

{{ t('settings.save.hint.output_file_name') }}

diff --git a/src/frontend/composables/useEnv.ts b/src/frontend/composables/useEnv.ts index 077cf86..5e74f7e 100644 --- a/src/frontend/composables/useEnv.ts +++ b/src/frontend/composables/useEnv.ts @@ -1,6 +1,19 @@ import { useLocalStorage } from '@vueuse/core' import { DEFAULT_ENV } from '../includes/constants' +/** + * Provides a reactive object that wraps all environment variables needed for audio identification in the backend. Any changes made to this object will be immediately reflected in the `env` key of the localStorage. + * + * @returns A reactive object representing the environment variables. + * + * @example + * ```ts + * const env = useEnv(); + * + * // Updating the SERVICE_API_KEY environment variable + * env.SERVICE_API_KEY = 'somekey'; + * ``` + */ export function useEnv() { return useLocalStorage('env', DEFAULT_ENV) } diff --git a/src/frontend/composables/useSaveSettings.ts b/src/frontend/composables/useSaveSettings.ts index 32499a5..7b0abb4 100644 --- a/src/frontend/composables/useSaveSettings.ts +++ b/src/frontend/composables/useSaveSettings.ts @@ -1,6 +1,19 @@ import { useLocalStorage } from '@vueuse/core' import { DEFAULT_SAVE_SETTINGS } from '../includes/constants' +/** + * Provides a reactive object that wraps save settings. Any changes made to this object will be immediately reflected in the `save-settings` key of the localStorage. + * + * @returns A reactive object representing audio identification settings. + * + * @example + * ```ts + * const saveSettings = useSaveSetings(); + * + * // Updating the fileType in audio identification settings + * saveSettings.value.fileType = 'wav'; + * ``` + */ export function useSaveSetings() { return useLocalStorage('save-settings', DEFAULT_SAVE_SETTINGS) } diff --git a/src/frontend/index.html b/src/frontend/index.html index cea39a0..11ed194 100644 --- a/src/frontend/index.html +++ b/src/frontend/index.html @@ -4,8 +4,7 @@ %VITE_APP_NAME% - - +
diff --git a/src/frontend/public/logo.ico b/src/frontend/public/logo.ico index 197323a..67eeb7c 100644 Binary files a/src/frontend/public/logo.ico and b/src/frontend/public/logo.ico differ diff --git a/src/frontend/public/logo.svg b/src/frontend/public/logo.svg new file mode 100644 index 0000000..ee8d0e6 --- /dev/null +++ b/src/frontend/public/logo.svg @@ -0,0 +1,8 @@ + + + + diff --git a/src/frontend/vue-i18n.d.ts b/src/frontend/vue-i18n.d.ts deleted file mode 100644 index 7d02f25..0000000 --- a/src/frontend/vue-i18n.d.ts +++ /dev/null @@ -1,4296 +0,0 @@ -import type { App } from 'vue'; -import type { ComponentInternalInstance } from 'vue'; -import type { ComputedRef } from 'vue'; -import { DateTimeOptions } from '@intlify/core-base'; -import { FallbackLocale } from '@intlify/core-base'; -import type { FallbackLocales } from '@intlify/core-base'; -import { InjectionKey } from 'vue'; -import { DateTimeFormat as IntlDateTimeFormat } from '@intlify/core-base'; -import { DateTimeFormats as IntlDateTimeFormats } from '@intlify/core-base'; -import { FormatMatcher as IntlFormatMatcher } from '@intlify/core-base'; -import { LocaleMatcher as IntlLocaleMatcher } from '@intlify/core-base'; -import { NumberFormat as IntlNumberFormat } from '@intlify/core-base'; -import { NumberFormats as IntlNumberFormats } from '@intlify/core-base'; -import { IsEmptyObject } from '@intlify/core-base'; -import { IsNever } from '@intlify/core-base'; -import { LinkedModifiers } from '@intlify/core-base'; -import { Locale } from '@intlify/core-base'; -import type { LocaleMessage } from '@intlify/core-base'; -import { LocaleMessageDictionary } from '@intlify/core-base'; -import { LocaleMessages } from '@intlify/core-base'; -import { LocaleMessageType } from '@intlify/core-base'; -import { LocaleMessageValue } from '@intlify/core-base'; -import type { LocaleParams } from '@intlify/core-base'; -import { MessageFunction } from '@intlify/core-base'; -import { MessageFunctions } from '@intlify/core-base'; -import type { MessageResolver } from '@intlify/core-base'; -import { NamedValue } from '@intlify/core-base'; -import { NumberOptions } from '@intlify/core-base'; -import type { ObjectDirective } from 'vue'; -import { Path } from '@intlify/core-base'; -import { PathValue } from '@intlify/core-base'; -import type { PickupFormatKeys } from '@intlify/core-base'; -import { PickupFormatPathKeys } from '@intlify/core-base'; -import { PickupKeys } from '@intlify/core-base'; -import type { PickupLocales } from '@intlify/core-base'; -import { PickupPaths } from '@intlify/core-base'; -import { PluralizationRule } from '@intlify/core-base'; -import type { PluralizationRules } from '@intlify/core-base'; -import { PostTranslationHandler } from '@intlify/core-base'; -import type { RemoveIndexSignature } from '@intlify/core-base'; -import type { ResourcePath } from '@intlify/core-base'; -import type { ResourceValue } from '@intlify/core-base'; -import type { SchemaParams } from '@intlify/core-base'; -import { TranslateOptions } from '@intlify/core-base'; -import type { VNode } from 'vue'; -import type { WritableComputedRef } from 'vue'; - -/** - * BaseFormat Props for Components that is offered Vue I18n - * - * @remarks - * The interface definitions of the underlying props of components such as Translation, DatetimeFormat, and NumberFormat. - * - * @VueI18nComponent - */ -export declare interface BaseFormatProps { - /** - * @remarks - * Used to wrap the content that is distribute in the slot. If omitted, the slot content is treated as Fragments. - * - * You can specify a string-based tag name, such as `p`, or the object for which the component is defined. - */ - tag?: string | object; - /** - * @remarks - * Specifies the locale to be used for the component. - * - * If specified, the global scope or the locale of the parent scope of the target component will not be overridden and the specified locale will be used. - */ - locale?: Locale; - /** - * @remarks - * Specifies the scope to be used in the target component. - * - * You can specify either `global` or `parent`. - * - * If `global` is specified, global scope is used, else then `parent` is specified, the scope of the parent of the target component is used. - * - * If the parent is a global scope, the global scope is used, if it's a local scope, the local scope is used. - */ - scope?: ComponetI18nScope; - /** - * @remarks - * A composer instance with an existing scope. - * - * This option takes precedence over the `scope` option. - */ - i18n?: Composer; -} - -/** - * Cast to VueI18n legacy compatible type - * - * @remarks - * This API is provided only with [vue-i18n-bridge](https://vue-i18n.intlify.dev/guide/migration/ways.html#what-is-vue-i18n-bridge). - * - * The purpose of this function is to convert an {@link I18n} instance created with {@link createI18n | createI18n(legacy: true)} into a `vue-i18n@v8.x` compatible instance of `new VueI18n` in a TypeScript environment. - * - * @param i18n - An instance of {@link I18n} - * @returns A i18n instance which is casted to {@link VueI18n} type - * - * @VueI18nTip - * :new: provided by **vue-i18n-bridge only** - * - * @VueI18nGeneral - */ -export declare const castToVueI18n: (i18n: I18n) => VueI18n<{}, {}, {}, string, never, string, Composer<{}, {}, {}, string, never, string>> & { - install: (Vue: any, options?: any) => void; -}; - -export declare type Choice = number; - -export declare type ComponentInstanceCreatedListener = (target: VueI18n, global: VueI18n) => void; - -export declare type ComponetI18nScope = Exclude; - -/** - * Composer interfaces - * - * @remarks - * This is the interface for being used for Vue 3 Composition API. - * - * @VueI18nComposition - */ -export declare interface Composer> | PickupLocales> | PickupLocales>, Locales = OptionLocale extends Locale ? [ResourceLocales] extends [never] ? Locale : ResourceLocales : OptionLocale | ResourceLocales> extends ComposerCustom { - /** - * @remarks - * Instance ID. - */ - id: number; - /** - * @remarks - * The current locale this Composer instance is using. - * - * If the locale contains a territory and a dialect, this locale contains an implicit fallback. - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - */ - locale: WritableComputedRef; - /** - * @remarks - * The current fallback locales this Composer instance is using. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - fallbackLocale: WritableComputedRef>; - /** - * @remarks - * Whether inherit the root level locale to the component localization locale. - * - * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2) - */ - inheritLocale: boolean; - /** - * @remarks - * The list of available locales in `messages` in lexical order. - */ - readonly availableLocales: Locales[]; - /** - * @remarks - * The locale messages of localization. - * - * @VueI18nSee [Getting Started](../guide/) - */ - readonly messages: ComputedRef<{ - [K in keyof Messages]: Messages[K]; - }>; - /** - * @remarks - * The datetime formats of localization. - * - * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime) - */ - readonly datetimeFormats: ComputedRef<{ - [K in keyof DateTimeFormats]: DateTimeFormats[K]; - }>; - /** - * @remarks - * The number formats of localization. - * - * @VueI18nSee [Number Formatting](../guide/essentials/number) - */ - readonly numberFormats: ComputedRef<{ - [K in keyof NumberFormats]: NumberFormats[K]; - }>; - /** - * @remarks - * Custom Modifiers for linked messages. - * - * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers) - */ - readonly modifiers: LinkedModifiers; - /** - * @remarks - * A set of rules for word pluralization - * - * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization) - */ - readonly pluralRules: PluralizationRules; - /** - * @remarks - * Whether this composer instance is global or not - */ - readonly isGlobal: boolean; - /** - * @remarks - * Whether suppress warnings outputted when localization fails. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - missingWarn: boolean | RegExp; - /** - * @remarks - * Whether suppress fall back warnings when localization fails. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - fallbackWarn: boolean | RegExp; - /** - * @remarks - * Whether to fall back to root level (global scope) localization when localization fails. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - fallbackRoot: boolean; - /** - * @remarks - * Whether suppress warnings when falling back to either `fallbackLocale` or root. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - fallbackFormat: boolean; - /** - * @remarks - * Whether to allow the use locale messages of HTML formatting. - * - * If you set `false`, will check the locale messages on the Composer instance. - * - * If you are specified `true`, a warning will be output at console. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value) - */ - warnHtmlMessage: boolean; - /** - * @remarks - * Whether interpolation parameters are escaped before the message is translated. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - */ - escapeParameter: boolean; - /** - * Locale message translation - * - * @remarks - * About details functions, See the {@link ComposerTranslation} - */ - t: ComposerTranslation>; - /** - * Resolve locale message translation - * - * @remarks - * About details functions, See the {@link ComposerResolveLocaleMessageTranslation} - */ - rt: ComposerResolveLocaleMessageTranslation; - /** - * Datetime formatting - * - * @remarks - * About details functions, See the {@link ComposerDateTimeFormatting} - */ - d: ComposerDateTimeFormatting>; - /** - * Number Formatting - * - * @remarks - * About details functions, See the {@link ComposerNumberFormatting} - */ - n: ComposerNumberFormatting>; - /** - * Translation locale message exist - * - * @remarks - * whether do exist locale message on Composer instance [messages](composition#messages). - * - * If you specified `locale`, check the locale messages of `locale`. - * - * @param key - A target locale message key - * @param locale - A locale, it will be used over than global scope or local scope - * - * @returns If found locale message, `true`, else `false` - */ - te = PickupKeys>(key: Str | Key, locale?: Locales): boolean; - /** - * Locale messages getter - * - * @remarks - * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope locale messages than global scope locale messages. - * - * Based on the current `locale`, locale messages will be returned from Composer instance messages. - * - * If you change the `locale`, the locale messages returned will also correspond to the locale. - * - * If there are no locale messages for the given `key` in the composer instance messages, they will be returned with [fallbacking](../guide/essentials/fallback). - * - * @VueI18nWarning - * You need to use `rt` for the locale message returned by `tm`. see the [rt](composition#rt-message) details. - * - * @example - * template block: - * ```html - *
- * - *
- * ``` - * script block: - * ```js - * import { defineComponent } from 'vue - * import { useI18n } from 'vue-i18n' - * - * export default defineComponent({ - * setup() { - * const { rt, tm } = useI18n({ - * messages: { - * en: { - * contents: [ - * { - * title: 'Title1', - * // ... - * paragraphs: [ - * // ... - * ] - * } - * ] - * } - * } - * // ... - * }) - * // ... - * return { ... , rt, tm } - * } - * }) - * ``` - * - * @param key - A target locale message key - * - * @return Locale messages - */ - tm = PickupKeys, Locale extends PickupLocales> = PickupLocales>, Target = IsEmptyObject extends false ? NonNullable[Locale] : RemoveIndexSignature<{ - [K in keyof DefineLocaleMessage]: DefineLocaleMessage[K]; - }>, Return = ResourceKeys extends ResourcePath ? ResourceValue : Record>(key: Key | ResourceKeys): Return; - /** - * Get locale message - * - * @remarks - * get locale message from Composer instance [messages](composition#messages). - * - * @param locale - A target locale - * - * @typeParam MessageSchema - The locale message schema, default `never` - * - * @returns Locale messages - */ - getLocaleMessage = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, Return = IsNever extends true ? IsEmptyObject extends true ? RemoveIndexSignature<{ - [K in keyof DefineLocaleMessage]: DefineLocaleMessage[K]; - }> : NonNullable[Locale] : MessageSchema>(locale: LocaleSchema | Locale): Return; - /** - * Set locale message - * - * @remarks - * Set locale message to Composer instance [messages](composition#messages). - * - * @param locale - A target locale - * @param message - A message - * - * @typeParam MessageSchema - The locale message schema, default `never` - */ - setLocaleMessage = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, MessageType = IsNever extends true ? IsEmptyObject extends true ? RemoveIndexSignature<{ - [K in keyof DefineLocaleMessage]: DefineLocaleMessage[K]; - }> : NonNullable[Locale] : MessageSchema, Message extends MessageType = MessageType>(locale: LocaleSchema | Locale, message: Message): void; - /** - * Merge locale message - * - * @remarks - * Merge locale message to Composer instance [messages](composition#messages). - * - * @param locale - A target locale - * @param message - A message - * - * @typeParam MessageSchema - The locale message schema, default `never` - */ - mergeLocaleMessage = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, Message = IsNever extends true ? Record : MessageSchema>(locale: LocaleSchema | Locale, message: Message): void; - /** - * Get datetime format - * - * @remarks - * get datetime format from Composer instance [datetimeFormats](composition#datetimeformats). - * - * @param locale - A target locale - * - * @typeParam DateTimeSchema - The datetime format schema, default `never` - * - * @returns Datetime format - */ - getDateTimeFormat = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, Return = IsNever extends true ? IsEmptyObject extends true ? RemoveIndexSignature<{ - [K in keyof DefineDateTimeFormat]: DefineDateTimeFormat[K]; - }> : NonNullable[Locale] : DateTimeSchema>(locale: LocaleSchema | Locale): Return; - /** - * Set datetime format - * - * @remarks - * Set datetime format to Composer instance [datetimeFormats](composition#datetimeformats). - * - * @param locale - A target locale - * @param format - A target datetime format - * - * @typeParam DateTimeSchema - The datetime format schema, default `never` - */ - setDateTimeFormat = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, FormatsType = IsNever extends true ? IsEmptyObject extends true ? RemoveIndexSignature<{ - [K in keyof DefineDateTimeFormat]: DefineDateTimeFormat[K]; - }> : NonNullable[Locale] : DateTimeSchema, Formats extends FormatsType = FormatsType>(locale: LocaleSchema | Locale, format: Formats): void; - /** - * Merge datetime format - * - * @remarks - * Merge datetime format to Composer instance [datetimeFormats](composition#datetimeformats). - * - * @param locale - A target locale - * @param format - A target datetime format - * - * @typeParam DateTimeSchema - The datetime format schema, default `never` - */ - mergeDateTimeFormat = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, Formats = IsNever extends true ? Record : DateTimeSchema>(locale: LocaleSchema | Locale, format: Formats): void; - /** - * Get number format - * - * @remarks - * get number format from Composer instance [numberFormats](composition#numberFormats). - * - * @param locale - A target locale - * - * @typeParam NumberSchema - The number format schema, default `never` - * - * @returns Number format - */ - getNumberFormat = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, Return = IsNever extends true ? IsEmptyObject extends true ? RemoveIndexSignature<{ - [K in keyof DefineNumberFormat]: DefineNumberFormat[K]; - }> : NonNullable[Locale] : NumberSchema>(locale: LocaleSchema | Locale): Return; - /** - * Set number format - * - * @remarks - * Set number format to Composer instance [numberFormats](composition#numberFormats). - * - * @param locale - A target locale - * @param format - A target number format - * - * @typeParam NumberSchema - The number format schema, default `never` - */ - setNumberFormat = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, FormatsType = IsNever extends true ? IsEmptyObject extends true ? RemoveIndexSignature<{ - [K in keyof DefineNumberFormat]: DefineNumberFormat[K]; - }> : NonNullable[Locale] : NumberSchema, Formats extends FormatsType = FormatsType>(locale: LocaleSchema | Locale, format: Formats): void; - /** - * Merge number format - * - * @remarks - * Merge number format to Composer instance [numberFormats](composition#numberFormats). - * - * @param locale - A target locale - * @param format - A target number format - * - * @typeParam NumberSchema - The number format schema, default `never` - */ - mergeNumberFormat = never, LocaleSchema extends string = string, Locale extends PickupLocales> = PickupLocales>, Formats = IsNever extends true ? Record : NumberSchema>(locale: LocaleSchema | Locale, format: Formats): void; - /** - * Get post translation handler - * - * @returns {@link PostTranslationHandler} - * - * @VueI18nSee [missing](composition#posttranslation) - */ - getPostTranslationHandler(): PostTranslationHandler | null; - /** - * Set post translation handler - * - * @param handler - A {@link PostTranslationHandler} - * - * @VueI18nSee [missing](composition#posttranslation) - */ - setPostTranslationHandler(handler: PostTranslationHandler | null): void; - /** - * Get missing handler - * - * @returns {@link MissingHandler} - * - * @VueI18nSee [missing](composition#missing) - */ - getMissingHandler(): MissingHandler | null; - /** - * Set missing handler - * - * @param handler - A {@link MissingHandler} - * - * @VueI18nSee [missing](composition#missing) - */ - setMissingHandler(handler: MissingHandler | null): void; -} - -/** - * Composer additional options for `useI18n` - * - * @remarks - * `ComposerAdditionalOptions` is extend for {@link ComposerOptions}, so you can specify these options. - * - * @VueI18nSee [useI18n](composition#usei18n) - * - * @VueI18nComposition - */ -export declare interface ComposerAdditionalOptions { - useScope?: I18nScope; -} - -/** - * The type custom definition of Composer - * - * @remarks - * - * The interface that can extend Composer. - * - * The type defined by 3rd party (e.g. nuxt/i18n) - * - * @example - * ```ts - * // vue-i18n.d.ts (`.d.ts` file at your app) - * - * declare module 'vue-i18n' { - * interface ComposerCustom { - * localeCodes: string[] - * } - * } - * ``` - * - * @VueI18nComposition - */ -export declare interface ComposerCustom { -} - -/** - * Datetime formatting functions - * - * @remarks - * This is the interface for {@link Composer} - * - * @VueI18nComposition - */ -export declare interface ComposerDateTimeFormatting = RemovedIndexResources, C = IsEmptyObject extends false ? PickupFormatPathKeys<{ - [K in keyof DefinedDateTimeFormat]: DefinedDateTimeFormat[K]; -}> : never, M = IsEmptyObject extends false ? PickupFormatKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Datetime formatting - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope datetime formats than global scope datetime formats. - * - * If not, then it’s formatted with global scope datetime formats. - * - * @param value - A value, timestamp number or `Date` instance or ISO 8601 string - * - * @returns Formatted value - * - * @VueI18nSee [Datetime formatting](../guide/essentials/datetime) - */ - (value: number | Date | string): string; - /** - * Datetime formatting - * - * @remarks - * Overloaded `d`. About details, see the [call signature](composition#value-number-date-string-string) details. - * - * In this overloaded `d`, format in datetime format for a key registered in datetime formats. - * - * @param value - A value, timestamp number or `Date` instance or ISO 8601 string - * @param keyOrOptions - A key of datetime formats, or additional {@link DateTimeOptions | options} for datetime formatting - * - * @returns Formatted value - */ - (value: Value, keyOrOptions: Key | ResourceKeys | DateTimeOptions): string; - /** - * Datetime formatting - * - * @remarks - * Overloaded `d`. About details, see the [call signature](composition#value-number-date-string-string) details. - * - * In this overloaded `d`, format in datetime format for a key registered in datetime formats at target locale - * - * @param value - A value, timestamp number or `Date` instance or ISO 8601 string - * @param keyOrOptions - A key of datetime formats, or additional {@link DateTimeOptions | options} for datetime formatting - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Formatted value - */ - (value: Value, keyOrOptions: Key | ResourceKeys | DateTimeOptions, locale: Locales): string; -} - -/** - * Number formatting functions - * - * @remarks - * This is the interface for {@link Composer} - * - * @VueI18nComposition - */ -export declare interface ComposerNumberFormatting = RemovedIndexResources, C = IsEmptyObject extends false ? PickupFormatPathKeys<{ - [K in keyof DefinedNumberFormat]: DefinedNumberFormat[K]; -}> : never, M = IsEmptyObject extends false ? PickupFormatKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Number Formatting - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope datetime formats than global scope datetime formats. - * - * If not, then it’s formatted with global scope number formats. - * - * @param value - A number value - * - * @returns Formatted value - * - * @VueI18nSee [Number formatting](../guide/essentials/number) - */ - (value: number): string; - /** - * Number Formatting - * - * @remarks - * Overloaded `n`. About details, see the [call signature](composition#value-number-string) details. - * - * In this overloaded `n`, format in number format for a key registered in number formats. - * - * @param value - A number value - * @param keyOrOptions - A key of number formats, or additional {@link NumberOptions | options} for number formatting - * - * @returns Formatted value - */ - (value: number, keyOrOptions: Key | ResourceKeys | NumberOptions): string; - /** - * Number Formatting - * - * @remarks - * Overloaded `n`. About details, see the [call signature](composition#value-number-string) details. - * - * In this overloaded `n`, format in number format for a key registered in number formats at target locale. - * - * @param value - A number value - * @param keyOrOptions - A key of number formats, or additional {@link NumberOptions | options} for number formatting - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Formatted value - */ - (value: number, keyOrOptions: Key | ResourceKeys | NumberOptions, locale: Locales): string; -} - -/** - * Composer Options - * - * @remarks - * This is options to create composer. - * - * @VueI18nComposition - */ -export declare interface ComposerOptions = LocaleMessages, _DateTimeFormats extends IntlDateTimeFormats = IntlDateTimeFormats, _NumberFormats extends IntlNumberFormats = IntlNumberFormats> { - /** - * @remarks - * The locale of localization. - * - * If the locale contains a territory and a dialect, this locale contains an implicit fallback. - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - * - * @defaultValue `'en-US'` - */ - locale?: Locale; - /** - * @remarks - * The locale of fallback localization. - * - * For more complex fallback definitions see fallback. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue The default `'en-US'` for the `locale` if it's not specified, or it's `locale` value - */ - fallbackLocale?: FallbackLocale; - /** - * @remarks - * Whether inheritance the root level locale to the component localization locale. - * - * If `false`, regardless of the root level locale, localize for each component locale. - * - * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2) - * - * @defaultValue `true` - */ - inheritLocale?: boolean; - /** - * @remarks - * The locale messages of localization. - * - * @VueI18nSee [Getting Started](../guide/) - * - * @defaultValue `{}` - */ - messages?: { - [K in keyof _Messages]: MessageSchema; - }; - /** - * @remarks - * Allow use flat json messages or not - * - * @defaultValue `false` - */ - flatJson?: boolean; - /** - * @remarks - * The datetime formats of localization. - * - * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime) - * - * @defaultValue `{}` - */ - datetimeFormats?: { - [K in keyof _DateTimeFormats]: DateTimeSchema; - }; - /** - * @remarks - * The number formats of localization. - * - * @VueI18nSee [Number Formatting](../guide/essentials/number) - * - * @defaultValue `{}` - */ - numberFormats?: { - [K in keyof _NumberFormats]: NumberSchema; - }; - /** - * @remarks - * Custom Modifiers for linked messages. - * - * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers) - */ - modifiers?: LinkedModifiers; - /** - * @remarks - * A set of rules for word pluralization - * - * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization) - * - * @defaultValue `{}` - */ - pluralRules?: PluralizationRules; - /** - * @remarks - * A handler for localization missing. - * - * The handler gets called with the localization target locale, localization path key, the Vue instance and values. - * - * If missing handler is assigned, and occurred localization missing, it's not warned. - * - * @defaultValue `null` - */ - missing?: MissingHandler; - /** - * @remarks - * Whether suppress warnings outputted when localization fails. - * - * If `false`, suppress localization fail warnings. - * - * If you use regular expression, you can suppress localization fail warnings that it match with translation key (e.g. `t`). - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `true` - */ - missingWarn?: boolean | RegExp; - /** - * @remarks - * Whether suppress warnings when falling back to either `fallbackLocale` or root. - * - * If `false`, suppress fall back warnings. - * - * If you use regular expression, you can suppress fallback warnings that it match with translation key (e.g. `t`). - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `true` - */ - fallbackWarn?: boolean | RegExp; - /** - * @remarks - * In the component localization, whether to fallback to root level (global scope) localization when localization fails. - * - * If `false`, it's not fallback to root. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `true` - */ - fallbackRoot?: boolean; - /** - * @remarks - * Whether do template interpolation on translation keys when your language lacks a translation for a key. - * - * If `true`, skip writing templates for your "base" language; the keys are your templates. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `false` - */ - fallbackFormat?: boolean; - /** - * @remarks - * A handler for post processing of translation. - * - * The handler gets after being called with the `t`. - * - * This handler is useful if you want to filter on translated text such as space trimming. - * - * @defaultValue `null` - */ - postTranslation?: PostTranslationHandler; - /** - * @remarks - * Whether to allow the use locale messages of HTML formatting. - * - * See the warnHtmlMessage property. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value) - * - * @defaultValue `'off'` - */ - warnHtmlMessage?: boolean; - /** - * @remarks - * If `escapeParameter` is configured as true then interpolation parameters are escaped before the message is translated. - * - * This is useful when translation output is used in `v-html` and the translation resource contains html markup (e.g. around a user provided value). - * - * This usage pattern mostly occurs when passing precomputed text strings into UI components. - * - * The escape process involves replacing the following symbols with their respective HTML character entities: `<`, `>`, `"`, `'`. - * - * Setting `escapeParameter` as true should not break existing functionality but provides a safeguard against a subtle type of XSS attack vectors. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - * - * @defaultValue `false` - */ - escapeParameter?: boolean; - /** - * @remarks - * A message resolver to resolve [`messages`](composition#messages). - * - * If not specified, the vue-i18n internal message resolver will be used by default. - * - * You need to implement a message resolver yourself that supports the following requirements: - * - * - Resolve the message using the locale message of [`locale`](composition#locale) passed as the first argument of the message resolver, and the path passed as the second argument. - * - * - If the message could not be resolved, you need to return `null`. - * - * - If you will be returned `null`, the message resolver will also be called on fallback if [`fallbackLocale`](composition#fallbacklocale-2) is enabled, so the message will need to be resolved as well. - * - * The message resolver is called indirectly by the following APIs: - * - * - [`t`](composition#t-key) - * - * - [`te`](composition#te-key-locale) - * - * - [`tm`](composition#tm-key) - * - * - [Translation component](component#translation) - * - * @example - * Here is an example of how to set it up using your `createI18n`: - * ```js - * import { createI18n } from 'vue-i18n' - * - * // your message resolver - * function messageResolver(obj, path) { - * // simple message resolving! - * const msg = obj[path] - * return msg != null ? msg : null - * } - * - * // call with I18n option - * const i18n = createI18n({ - * legacy: false, - * locale: 'ja', - * messageResolver, // set your message resolver - * messages: { - * en: { ... }, - * ja: { ... } - * } - * }) - * - * // the below your something to do ... - * // ... - * ``` - * - * @VueI18nTip - * :new: v9.2+ - * - * @VueI18nWarning - * If you use the message resolver, the [`flatJson`](composition#flatjson) setting will be ignored. That is, you need to resolve the flat JSON by yourself. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `undefined` - */ - messageResolver?: MessageResolver; -} - -/** - * Resolve locale message translation functions - * - * @remarks - * This is the interface for {@link Composer} - * - * @VueI18nComposition - */ -export declare interface ComposerResolveLocaleMessageTranslation { - /** - * Resolve locale message translation - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope locale messages than global scope locale messages. - * - * If not, then it’s translated with global scope locale messages. - * - * @VueI18nTip - * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement. - * - * @VueI18nWarning - * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`. - * - * @returns Translated message - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - */ - (message: MessageFunction | VueMessageType): string; - /** - * Resolve locale message translation for plurals - * - * @remarks - * Overloaded `rt`. About details, see the [call signature](composition#message-messagefunction-message-message-string) details. - * - * In this overloaded `rt`, return a pluralized translation message. - * - * @VueI18nTip - * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement. - * - * @VueI18nWarning - * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`. - * @param plural - Which plural string to get. 1 returns the first one. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - * - * @VueI18nSee [Pluralization](../guide/essentials/pluralization) - */ - (message: MessageFunction | VueMessageType, plural: number, options?: TranslateOptions): string; - /** - * Resolve locale message translation for list interpolations - * - * @remarks - * Overloaded `rt`. About details, see the [call signature](composition#message-messagefunction-message-message-string) details. - * - * In this overloaded `rt`, return a pluralized translation message. - * - * @VueI18nTip - * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement. - * - * @VueI18nWarning - * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`. - * @param list - A values of list interpolation. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - * - * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation) - */ - (message: MessageFunction | VueMessageType, list: unknown[], options?: TranslateOptions): string; - /** - * Resolve locale message translation for named interpolations - * - * @remarks - * Overloaded `rt`. About details, see the [call signature](composition#message-messagefunction-message-message-string) details. - * - * In this overloaded `rt`, for each placeholder x, the locale messages should contain a `{x}` token. - * - * @VueI18nTip - * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement. - * - * @VueI18nWarning - * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`. - * @param named - A values of named interpolation. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - * - * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation) - */ - (message: MessageFunction | VueMessageType, named: NamedValue, options?: TranslateOptions): string; -} - -/** - * Locale message translation functions - * - * @remarks - * This is the interface for {@link Composer} - * - * @VueI18nComposition - */ -export declare interface ComposerTranslation = RemovedIndexResources, C = IsEmptyObject extends false ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]; -}> : never, M = IsEmptyObject extends false ? PickupKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Locale message translation - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope locale messages than global scope locale messages. - * - * If not, then it’s translated with global scope locale messages. - * - * @param key - A target locale message key - * - * @returns Translated message - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - */ - (key: Key | ResourceKeys | number): string; - /** - * Locale message translation for plurals - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, return a pluralized translation message. - * - * You can also suppress the warning, when the translation missing according to the options. - * - * About details of options, see the {@link TranslateOptions}. - * - * @param key - A target locale message key - * @param plural - Which plural string to get. 1 returns the first one. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - * - * @VueI18nSee [Pluralization](../guide/essentials/pluralization) - */ - (key: Key | ResourceKeys | number, plural: number, options?: TranslateOptions): string; - /** - * Locale message translation for missing default message - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, if no translation was found, return a default message. - * - * You can also suppress the warning, when the translation missing according to the options. - * - * About details of options, see the {@link TranslateOptions}. - * - * @param key - A target locale message key - * @param defaultMsg - A default message to return if no translation was found - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - */ - (key: Key | ResourceKeys | number, defaultMsg: string, options?: TranslateOptions): string; - /** - * Locale message translation for list interpolations - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, the locale messages should contain a `{0}`, `{1}`, … for each placeholder in the list. - * - * You can also suppress the warning, when the translation missing according to the options. - * - * About details of options, see the {@link TranslateOptions}. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - * - * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation) - */ - (key: Key | ResourceKeys | number, list: unknown[], options?: TranslateOptions): string; - /** - * Locale message translation for list interpolations and plurals - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, the locale messages should contain a `{0}`, `{1}`, … for each placeholder in the list, and return a pluralized translation message. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * @param plural - Which plural string to get. 1 returns the first one. - * - * @returns Translated message - * - * @VueI18nSee [Pluralization](../guide/essentials/pluralization) - * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation) - */ - (key: Key | ResourceKeys | number, list: unknown[], plural: number): string; - /** - * Locale message translation for list interpolations and missing default message - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, the locale messages should contain a `{0}`, `{1}`, … for each placeholder in the list, and if no translation was found, return a default message. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * @param defaultMsg - A default message to return if no translation was found - * - * @returns Translated message - * - * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation) - */ - (key: Key | ResourceKeys | number, list: unknown[], defaultMsg: string): string; - /** - * Locale message translation for named interpolations - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, for each placeholder x, the locale messages should contain a `{x}` token. - * - * You can also suppress the warning, when the translation missing according to the options. - * - * About details of options, see the {@link TranslateOptions}. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - * - * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation) - */ - (key: Key | ResourceKeys | number, named: NamedValue, options?: TranslateOptions): string; - /** - * Locale message translation for named interpolations and plurals - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, for each placeholder x, the locale messages should contain a `{x}` token, and return a pluralized translation message. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * @param plural - Which plural string to get. 1 returns the first one. - * - * @returns Translated message - * - * @VueI18nSee [Pluralization](../guide/essentials/pluralization) - * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation) - */ - (key: Key | ResourceKeys | number, named: NamedValue, plural: number): string; - /** - * Locale message translation for named interpolations and plurals - * - * @remarks - * Overloaded `t`. About details, see the [call signature](composition#key-key-resourcekeys-number-string) details. - * - * In this overloaded `t`, for each placeholder x, the locale messages should contain a `{x}` token, and if no translation was found, return a default message. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * @param defaultMsg - A default message to return if no translation was found - * - * @returns Translated message - * - * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation) - */ - (key: Key | ResourceKeys | number, named: NamedValue, defaultMsg: string): string; -} - -export declare function createI18n(options: Options, LegacyVueI18n?: any): typeof options['legacy'] extends true ? I18n : typeof options['legacy'] extends false ? I18n : I18n; - -/** - * Vue I18n factory - * - * @param options - An options, see the {@link I18nOptions} - * - * @typeParam Schema - The i18n resources (messages, datetimeFormats, numberFormats) schema, default {@link LocaleMessage} - * @typeParam Locales - The locales of i18n resource schema, default `en-US` - * @typeParam Legacy - Whether legacy mode is enabled or disabled, default `true` - * - * @returns {@link I18n} instance - * - * @remarks - * If you use Legacy API mode, you need toto specify {@link VueI18nOptions} and `legacy: true` option. - * - * If you use composition API mode, you need to specify {@link ComposerOptions}. - * - * @VueI18nSee [Getting Started](../guide/) - * @VueI18nSee [Composition API](../guide/advanced/composition) - * - * @example - * case: for Legacy API - * ```js - * import { createApp } from 'vue' - * import { createI18n } from 'vue-i18n' - * - * // call with I18n option - * const i18n = createI18n({ - * locale: 'ja', - * messages: { - * en: { ... }, - * ja: { ... } - * } - * }) - * - * const App = { - * // ... - * } - * - * const app = createApp(App) - * - * // install! - * app.use(i18n) - * app.mount('#app') - * ``` - * - * @example - * case: for composition API - * ```js - * import { createApp } from 'vue' - * import { createI18n, useI18n } from 'vue-i18n' - * - * // call with I18n option - * const i18n = createI18n({ - * legacy: false, // you must specify 'legacy: false' option - * locale: 'ja', - * messages: { - * en: { ... }, - * ja: { ... } - * } - * }) - * - * const App = { - * setup() { - * // ... - * const { t } = useI18n({ ... }) - * return { ... , t } - * } - * } - * - * const app = createApp(App) - * - * // install! - * app.use(i18n) - * app.mount('#app') - * ``` - * - * @VueI18nGeneral - */ -export declare function createI18n, LocaleParams> = I18nOptions, LocaleParams>, Messages = Options['messages'] extends object ? Options['messages'] : {}, DateTimeFormats = Options['datetimeFormats'] extends object ? Options['datetimeFormats'] : {}, NumberFormats = Options['numberFormats'] extends object ? Options['numberFormats'] : {}, OptionLocale = Options['locale'] extends string ? Options['locale'] : Locale>(options: Options, LegacyVueI18n?: any): typeof options['legacy'] extends true ? I18n : typeof options['legacy'] extends false ? I18n : I18n; - -export declare interface CustomBlock { - locale: Locale; - resource: LocaleMessages; -} - -export declare type CustomBlocks = Array>; - -/** - * Datetime Format Component - * - * @remarks - * See the following items for property about details - * - * @VueI18nSee [FormattableProps](component#formattableprops) - * @VueI18nSee [BaseFormatProps](component#baseformatprops) - * @VueI18nSee [Custom Formatting](../guide/essentials/datetime#custom-formatting) - * - * @VueI18nDanger - * Not supported IE, due to no support `Intl.DateTimeFormat#formatToParts` in [IE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) - * - * If you want to use it, you need to use [polyfill](https://github.com/formatjs/formatjs/tree/main/packages/intl-datetimeformat) - * - * @VueI18nComponent - */ -export declare const DatetimeFormat: { - name: string; - props: { - value: { - type: (NumberConstructor | DateConstructor)[]; - required: boolean; - }; - format: { - type: (ObjectConstructor | StringConstructor)[]; - }; - } & { - tag: { - type: (ObjectConstructor | StringConstructor)[]; - }; - locale: { - type: StringConstructor; - }; - scope: { - type: StringConstructor; - validator: (val: "parent" | "global") => boolean; - default: "parent" | "global"; - }; - i18n: { - type: ObjectConstructor; - }; - }; - setup(props: any, context: any): any; -}; - -/** - * DatetimeFormat Component Props - * - * @VueI18nComponent - */ -export declare type DatetimeFormatProps = FormattableProps; - -/** @VueI18nLegacy */ -export declare type DateTimeFormatResult = string; -export { DateTimeOptions } - -export declare type DefaultDateTimeFormatSchema> = IsEmptyObject extends true ? IntlDateTimeFormat : Schema; - -export declare type DefaultLocaleMessageSchema> = IsEmptyObject extends true ? LocaleMessage : Schema; - -export declare type DefaultNumberFormatSchema> = IsEmptyObject extends true ? IntlNumberFormat : Schema; - -/** - * The type definition of datetime format - * - * @remarks - * The typealias is used to strictly define the type of the Datetime format. - * - * The type defined by this can be used in the global scope. - * - * @example - * ```ts - * // type.d.ts (`.d.ts` file at your app) - * import { DefineDateTimeFormat } from 'vue-i18n' - * - * declare module 'vue-i18n' { - * export interface DefineDateTimeFormat { - * short: { - * hour: 'numeric' - * timezone: string - * } - * } - * } - * ``` - * - * @VueI18nGeneral - */ -export declare interface DefineDateTimeFormat extends IntlDateTimeFormat { -} - -/** - * The type definition of Locale Message - * - * @remarks - * The typealias is used to strictly define the type of the Locale message. - * - * The type defined by this can be used in the global scope. - * - * @example - * ```ts - * // type.d.ts (`.d.ts` file at your app) - * import { DefineLocaleMessage } from 'vue-i18n' - * - * declare module 'vue-i18n' { - * export interface DefineLocaleMessage { - * title: string - * menu: { - * login: string - * } - * } - * } - * ``` - * - * @VueI18nGeneral - */ -export declare interface DefineLocaleMessage extends LocaleMessage { -} - -/** - * The type definition of number format - * - * @remarks - * The typealias is used to strictly define the type of the Number format. - * - * The type defined by this can be used in the global scope. - * - * @example - * ```ts - * // type.d.ts (`.d.ts` file at your app) - * import { DefineNumberFormat } from 'vue-i18n' - * - * declare module 'vue-i18n' { - * export interface DefineNumberFormat { - * currency: { - * style: 'currency' - * currencyDisplay: 'symbol' - * currency: string - * } - * } - * } - * ``` - * - * @VueI18nGeneral - */ -export declare interface DefineNumberFormat extends IntlNumberFormat { -} - -/** - * Exported global composer instance - * - * @remarks - * This interface is the [global composer](general#global) that is provided interface that is injected into each component with `app.config.globalProperties`. - * - * @VueI18nGeneral - */ -export declare interface ExportedGlobalComposer { - /** - * Locale - * - * @remarks - * This property is proxy-like property for `Composer#locale`. About details, see the [Composer#locale](composition#locale) - */ - locale: Locale; - /** - * Fallback locale - * - * @remarks - * This property is proxy-like property for `Composer#fallbackLocale`. About details, see the [Composer#fallbackLocale](composition#fallbacklocale) - */ - fallbackLocale: FallbackLocale; - /** - * Available locales - * - * @remarks - * This property is proxy-like property for `Composer#availableLocales`. About details, see the [Composer#availableLocales](composition#availablelocales) - */ - readonly availableLocales: Locale[]; -} -export { FallbackLocale } - -/** - * Formattable Props - * - * @remarks - * The props used in DatetimeFormat, or NumberFormat component - * - * @VueI18nComponent - */ -export declare interface FormattableProps extends BaseFormatProps { - /** - * @remarks - * The value specified for the target component - */ - value: Value; - /** - * @remarks - * The format to use in the target component. - * - * Specify the format key string or the format as defined by the Intl API in ECMA 402. - */ - format?: string | Format; -} - -export declare interface Formatter { - interpolate(message: string, values: any, path: string): Array | null; -} - -/** - * I18n instance - * - * @remarks - * The instance required for installation as the Vue plugin - * - * @VueI18nGeneral - */ -export declare interface I18n { - /** - * Vue I18n API mode - * - * @remarks - * If you specified `legacy: true` option in `createI18n`, return `legacy`, else `composition` - * - * @defaultValue `'legacy'` - */ - readonly mode: I18nMode; - /** - * The property accessible to the global Composer instance or VueI18n instance - * - * @remarks - * If the [I18n#mode](general#mode) is `'legacy'`, then you can access to a global {@link VueI18n} instance, else then [I18n#mode](general#mode) is `'composition' `, you can access to the global {@link Composer} instance. - * - * An instance of this property is **global scope***. - */ - readonly global: Legacy extends true ? VueI18n : Legacy extends false ? Composer : unknown; - /** - * The property whether or not the Composition API is available - * - * @remarks - * If you specified `allowComposition: true` option in Legacy API mode, return `true`, else `false`. else you use the Composition API mode, this property will always return `true`. - */ - readonly allowComposition: boolean; - /** - * Install entry point - * - * @param app - A target Vue app instance - * @param options - An install options - */ - install(app: App, ...options: unknown[]): void; - /** - * Release global scope resource - */ - dispose(): void; -} - -/** - * I18n Additional Options - * - * @remarks - * Specific options for {@link createI18n} - * - * @VueI18nGeneral - */ -export declare interface I18nAdditionalOptions { - /** - * Whether vue-i18n Legacy API mode use on your Vue App - * - * @remarks - * The default is to use the Legacy API mode. If you want to use the Composition API mode, you need to set it to `false`. - * - * @VueI18nSee [Composition API](../guide/advanced/composition) - * - * @defaultValue `true` - */ - legacy?: boolean; - /** - * Whether to inject global properties & functions into for each component. - * - * @remarks - * If set to `true`, then properties and methods prefixed with `$` are injected into Vue Component. - * - * @VueI18nSee [Implicit with injected properties and functions](../guide/advanced/composition#implicit-with-injected-properties-and-functions) - * @VueI18nSee [ComponentCustomProperties](injection#componentcustomproperties) - * - * @defaultValue `true` - */ - globalInjection?: boolean; - /** - * Whether to allow the Composition API to be used in Legacy API mode. - * - * @remarks - * If this option is enabled, you can use {@link useI18n} in Legacy API mode. This option is supported to support the migration from Legacy API mode to Composition API mode. - * - * @VueI18nWarning Note that the Composition API made available with this option doesn't work on SSR. - * @VueI18nSee [Composition API](../guide/advanced/composition) - * - * @defaultValue `false` - */ - allowComposition?: boolean; -} - -/** - * Injection key for {@link useI18n} - * - * @remarks - * The global injection key for I18n instances with `useI18n`. this injection key is used in Web Components. - * Specify the i18n instance created by {@link createI18n} together with `provide` function. - * - * @VueI18nGeneral - */ -export declare const I18nInjectionKey: InjectionKey | string; - -/** - * Vue I18n API mode - * - * @VueI18nSee [I18n#mode](general#mode) - * - * @VueI18nGeneral - */ -export declare type I18nMode = 'legacy' | 'composition'; - -/** - * I18n Options for `createI18n` - * - * @remarks - * `I18nOptions` is inherited {@link I18nAdditionalOptions}, {@link ComposerOptions} and {@link VueI18nOptions}, - * so you can specify these options. - * - * @VueI18nGeneral - */ -export declare type I18nOptions | VueI18nOptions = ComposerOptions | VueI18nOptions> = I18nAdditionalOptions & Options; - -/** - * Vue I18n plugin options - * - * @remarks - * An options specified when installing Vue I18n as Vue plugin with using `app.use`. - * - * @VueI18nGeneral - */ -export declare interface I18nPluginOptions { - /** - * Whether to use the tag name `i18n` for Translation Component - * - * @remarks - * This option is used for compatibility with Vue I18n v8.x. - * - * If you can't migrate right away, you can temporarily enable this option, and you can work Translation Component. - * - * @defaultValue `false` - */ - useI18nComponentName?: boolean; - /** - * Whether to globally install the components that is offered by Vue I18n - * - * @remarks - * If this option is enabled, the components will be installed globally at `app.use` time. - * - * If you want to install manually in the `import` syntax, you can set it to `false` to install when needed. - * - * @defaultValue `true` - */ - globalInstall?: boolean; -} - -/** - * I18n Scope - * - * @VueI18nSee [ComposerAdditionalOptions#useScope](composition#usescope) - * @VueI18nSee [useI18n](composition#usei18n) - * - * @VueI18nGeneral - */ -export declare type I18nScope = 'local' | 'parent' | 'global'; -export { IntlDateTimeFormat } -export { IntlDateTimeFormats } -export { IntlFormatMatcher } -export { IntlLocaleMatcher } -export { IntlNumberFormat } -export { IntlNumberFormats } -export { IsEmptyObject } -export { IsNever } -export { LinkedModifiers } -export { Locale } -export { LocaleMessageDictionary } - -/** @VueI18nLegacy */ -export declare type LocaleMessageObject = LocaleMessageDictionary; -export { LocaleMessages } -export { LocaleMessageType } -export { LocaleMessageValue } -export { MessageFunction } -export { MessageFunctions } - -/** @VueI18nComposition */ -export declare type MissingHandler = (locale: Locale, key: Path, instance?: ComponentInternalInstance, type?: string) => string | void; -export { NamedValue } - -/** - * Number Format Component - * - * @remarks - * See the following items for property about details - * - * @VueI18nSee [FormattableProps](component#formattableprops) - * @VueI18nSee [BaseFormatProps](component#baseformatprops) - * @VueI18nSee [Custom Formatting](../guide/essentials/number#custom-formatting) - * - * @VueI18nDanger - * Not supported IE, due to no support `Intl.NumberFormat#formatToParts` in [IE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts) - * - * If you want to use it, you need to use [polyfill](https://github.com/formatjs/formatjs/tree/main/packages/intl-numberformat) - * - * @VueI18nComponent - */ -export declare const NumberFormat: { - name: string; - props: { - value: { - type: NumberConstructor; - required: boolean; - }; - format: { - type: (ObjectConstructor | StringConstructor)[]; - }; - } & { - tag: { - type: (ObjectConstructor | StringConstructor)[]; - }; - locale: { - type: StringConstructor; - }; - scope: { - type: StringConstructor; - validator: (val: "parent" | "global") => boolean; - default: "parent" | "global"; - }; - i18n: { - type: ObjectConstructor; - }; - }; - setup(props: any, context: any): any; -}; - -/** - * NumberFormat Component Props - * - * @VueI18nComponent - */ -export declare type NumberFormatProps = FormattableProps; - -/** @VueI18nLegacy */ -export declare type NumberFormatResult = string; -export { NumberOptions } -export { Path } -export { PathValue } -export { PickupFormatPathKeys } -export { PickupKeys } -export { PickupPaths } -export { PluralizationRule } - -export declare type PluralizationRulesMap = { - [locale: string]: PluralizationRule; -}; -export { PostTranslationHandler } - -export declare type RemovedIndexResources = RemoveIndexSignature<{ - [K in keyof T]: T[K]; -}>; -export { TranslateOptions } - -/** @VueI18nLegacy */ -export declare type TranslateResult = string; - -/** - * Translation Component - * - * @remarks - * See the following items for property about details - * - * @VueI18nSee [TranslationProps](component#translationprops) - * @VueI18nSee [BaseFormatProps](component#baseformatprops) - * @VueI18nSee [Component Interpolation](../guide/advanced/component) - * - * @example - * ```html - *
- * - * - * {{ $t('tos') }} - * - * - *
- * ``` - * ```js - * import { createApp } from 'vue' - * import { createI18n } from 'vue-i18n' - * - * const messages = { - * en: { - * tos: 'Term of Service', - * term: 'I accept xxx {0}.' - * }, - * ja: { - * tos: '利用規約', - * term: '私は xxx の{0}に同意します。' - * } - * } - * - * const i18n = createI18n({ - * locale: 'en', - * messages - * }) - * - * const app = createApp({ - * data: { - * url: '/term' - * } - * }).use(i18n).mount('#app') - * ``` - * - * @VueI18nComponent - */ -export declare const Translation: { - name: string; - props: { - keypath: { - type: StringConstructor; - required: boolean; - }; - plural: { - type: (StringConstructor | NumberConstructor)[]; - validator: (val: any) => boolean; - }; - } & { - tag: { - type: (ObjectConstructor | StringConstructor)[]; - }; - locale: { - type: StringConstructor; - }; - scope: { - type: StringConstructor; - validator: (val: "parent" | "global") => boolean; - default: "parent" | "global"; - }; - i18n: { - type: ObjectConstructor; - }; - }; - setup(props: any, context: any): any; -}; - -/** - * Translation Directive (`v-t`) - * - * @remarks - * Update the element `textContent` that localized with locale messages. - * - * You can use string syntax or object syntax. - * - * String syntax can be specified as a keypath of locale messages. - * - * If you can be used object syntax, you need to specify as the object key the following params - * - * ``` - * - path: required, key of locale messages - * - locale: optional, locale - * - args: optional, for list or named formatting - * ``` - * - * @example - * ```html - * - *

- * - * - *

- * - * - *

- * - * - *

- * ``` - * - * @VueI18nDirective - */ -export declare type TranslationDirective = ObjectDirective; - -/** - * Translation Component Props - * - * @VueI18nComponent - */ -export declare interface TranslationProps extends BaseFormatProps { - /** - * @remarks - * The locale message key can be specified prop - */ - keypath: string; - /** - * @remarks - * The Plural Choosing the message number prop - */ - plural?: number | string; -} - -export declare function useI18n(options?: Options): Composer, NonNullable, NonNullable, NonNullable>; - -/** - * Use Composition API for Vue I18n - * - * @param options - An options, see {@link UseI18nOptions} - * - * @typeParam Schema - The i18n resources (messages, datetimeFormats, numberFormats) schema, default {@link LocaleMessage} - * @typeParam Locales - The locales of i18n resource schema, default `en-US` - * - * @returns {@link Composer} instance - * - * @remarks - * This function is mainly used by `setup`. - * - * If options are specified, Composer instance is created for each component and you can be localized on the component. - * - * If options are not specified, you can be localized using the global Composer. - * - * @example - * case: Component resource base localization - * ```html - * - * - * - * ``` - * - * @VueI18nComposition - */ -export declare function useI18n, LocaleParams> = UseI18nOptions, LocaleParams>>(options?: Options): Composer, NonNullable, NonNullable, NonNullable>; - -/** - * I18n Options for `useI18n` - * - * @remarks - * `UseI18nOptions` is inherited {@link ComposerAdditionalOptions} and {@link ComposerOptions}, so you can specify these options. - * - * @VueI18nSee [useI18n](composition#usei18n) - * - * @VueI18nComposition - */ -export declare type UseI18nOptions = ComposerOptions> = ComposerAdditionalOptions & Options; - -/** - * Vue I18n Version - * - * @remarks - * Semver format. Same format as the package.json `version` field. - * - * @VueI18nGeneral - */ -export declare const VERSION: string; - -export declare function vTDirective(i18n: I18n): TranslationDirective; - -/** - * VueI18n legacy interfaces - * - * @remarks - * This interface is compatible with interface of `VueI18n` class (offered with Vue I18n v8.x). - * - * @VueI18nLegacy - */ -export declare interface VueI18n> | PickupLocales> | PickupLocales>, Locales = OptionLocale extends string ? [ResourceLocales] extends [never] ? Locale : ResourceLocales : OptionLocale | ResourceLocales, Composition extends Composer = Composer> { - /** - * @remarks - * Instance ID. - */ - id: number; - /** - * @remarks - * The current locale this VueI18n instance is using. - * - * If the locale contains a territory and a dialect, this locale contains an implicit fallback. - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - */ - locale: Locales; - /** - * @remarks - * The current fallback locales this VueI18n instance is using. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - fallbackLocale: FallbackLocales; - /** - * @remarks - * The list of available locales in `messages` in lexical order. - */ - readonly availableLocales: Composition['availableLocales']; - /** - * @remarks - * The locale messages of localization. - * - * @VueI18nSee [Getting Started](../guide/) - */ - readonly messages: { - [K in keyof Messages]: Messages[K]; - }; - /** - * @remarks - * The datetime formats of localization. - * - * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime) - */ - readonly datetimeFormats: { - [K in keyof DateTimeFormats]: DateTimeFormats[K]; - }; - /** - * @remarks - * The number formats of localization. - * - * @VueI18nSee [Number Formatting](../guide/essentials/number) - */ - readonly numberFormats: { - [K in keyof NumberFormats]: NumberFormats[K]; - }; - /** - * @remarks - * Custom Modifiers for linked messages. - * - * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers) - */ - readonly modifiers: Composition['modifiers']; - /** - * @remarks - * The formatter that implemented with Formatter interface. - * - * @deprecated See the [here](../guide/migration/breaking#remove-custom-formatter) - */ - formatter: Formatter; - /** - * @remarks - * A handler for localization missing. - */ - missing: MissingHandler | null; - /** - * @remarks - * A handler for post processing of translation. - */ - postTranslation: PostTranslationHandler | null; - /** - * @remarks - * Whether suppress warnings outputted when localization fails. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - silentTranslationWarn: Composition['missingWarn']; - /** - * @remarks - * Whether suppress fallback warnings when localization fails. - */ - silentFallbackWarn: Composition['fallbackWarn']; - /** - * @remarks - * Whether suppress warnings when falling back to either `fallbackLocale` or root. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - */ - formatFallbackMessages: Composition['fallbackFormat']; - /** - * @remarks - * Whether synchronize the root level locale to the component localization locale. - * - * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2) - */ - sync: Composition['inheritLocale']; - /** - * @remarks - * Whether to allow the use locale messages of HTML formatting. - * - * If you set `warn` or` error`, will check the locale messages on the VueI18n instance. - * - * If you are specified `warn`, a warning will be output at console. - * - * If you are specified `error` will occurred an Error. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value) - */ - warnHtmlInMessage: WarnHtmlInMessageLevel; - /** - * @remarks - * Whether interpolation parameters are escaped before the message is translated. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - */ - escapeParameterHtml: Composition['escapeParameter']; - /** - * @remarks - * Whether `v-t` directive's element should preserve `textContent` after directive is unbinded. - * - * @VueI18nSee [Custom Directive](../guide/advanced/directive) - * @VueI18nSee [Remove preserveDirectiveContent option](../guide/migration/breaking#remove-preservedirectivecontent-option) - * - * @deprecated The `v-t` directive for Vue 3 now preserves the default content. Therefore, this option and its properties have been removed from the VueI18n instance. - */ - preserveDirectiveContent: boolean; - /** - * A set of rules for word pluralization - * - * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization) - */ - pluralizationRules: Composition['pluralRules']; - /** - * Locale message translation - * - * @remarks - * About details functions, See the {@link VueI18nTranslation} - */ - t: VueI18nTranslation>; - /** - * Resolve locale message translation - * - * @remarks - * About details functions, See the {@link VueI18nResolveLocaleMessageTranslation} - */ - rt: VueI18nResolveLocaleMessageTranslation; - /** - * Locale message pluralization - * - * @remarks - * About details functions, See the {@link VueI18nTranslationChoice} - */ - tc: VueI18nTranslationChoice>; - /** - * Translation locale message exist - * - * @remarks - * whether do exist locale message on VueI18n instance [messages](legacy#messages). - * - * If you specified `locale`, check the locale messages of `locale`. - * - * @param key - A target locale message key - * @param locale - A target locale - * - * @returns If found locale message, `true`, else `false` - */ - te = PickupKeys>(key: Str | Key, locale?: Locales): boolean; - /** - * Locale messages getter - * - * @remarks - * If [i18n component options](injection#i18n) is specified, it’s get in preferentially local scope locale messages than global scope locale messages. - * - * If [i18n component options](injection#i18n) isn't specified, it’s get with global scope locale messages. - * - * Based on the current `locale`, locale messages will be returned from Composer instance messages. - * - * If you change the `locale`, the locale messages returned will also correspond to the locale. - * - * If there are no locale messages for the given `key` in the composer instance messages, they will be returned with [fallbacking](../guide/essentials/fallback). - * - * @VueI18nWarning - * You need to use `rt` for the locale message returned by `tm`. see the [rt](legacy#rt-message) details. - * - * @example - * template: - * ```html - *
- * - *
- * ``` - * - * ```js - * import { createI18n } from 'vue-i18n' - * - * const i18n = createI18n({ - * messages: { - * en: { - * contents: [ - * { - * title: 'Title1', - * // ... - * paragraphs: [ - * // ... - * ] - * } - * ] - * } - * } - * // ... - * }) - * ``` - * @param key - A target locale message key - * - * @return Locale messages - */ - tm: Composition['tm']; - /** - * Get locale message - * - * @remarks - * get locale message from VueI18n instance [messages](legacy#messages). - * - * @param locale - A target locale - * - * @returns Locale messages - */ - getLocaleMessage: Composition['getLocaleMessage']; - /** - * Set locale message - * - * @remarks - * Set locale message to VueI18n instance [messages](legacy#messages). - * - * @param locale - A target locale - * @param message - A message - */ - setLocaleMessage: Composition['setLocaleMessage']; - /** - * Merge locale message - * - * @remarks - * Merge locale message to VueI18n instance [messages](legacy#messages). - * - * @param locale - A target locale - * @param message - A message - */ - mergeLocaleMessage: Composition['mergeLocaleMessage']; - /** - * Datetime formatting - * - * @remarks - * About details functions, See the {@link VueI18nDateTimeFormatting} - */ - d: VueI18nDateTimeFormatting>; - /** - * Get datetime format - * - * @remarks - * get datetime format from VueI18n instance [datetimeFormats](legacy#datetimeformats). - * - * @param locale - A target locale - * - * @returns Datetime format - */ - getDateTimeFormat: Composition['getDateTimeFormat']; - /** - * Set datetime format - * - * @remarks - * Set datetime format to VueI18n instance [datetimeFormats](legacy#datetimeformats). - * - * @param locale - A target locale - * @param format - A target datetime format - */ - setDateTimeFormat: Composition['setDateTimeFormat']; - /** - * Merge datetime format - * - * @remarks - * Merge datetime format to VueI18n instance [datetimeFormats](legacy#datetimeformats). - * - * @param locale - A target locale - * @param format - A target datetime format - */ - mergeDateTimeFormat: Composition['mergeDateTimeFormat']; - /** - * Number Formatting - * - * @remarks - * About details functions, See the {@link VueI18nNumberFormatting} - */ - n: VueI18nNumberFormatting>; - /** - * Get number format - * - * @remarks - * get number format from VueI18n instance [numberFormats](legacy#numberFormats). - * - * @param locale - A target locale - * - * @returns Number format - */ - getNumberFormat: Composition['getNumberFormat']; - /** - * Set number format - * - * @remarks - * Set number format to VueI18n instance [numberFormats](legacy#numberFormats). - * - * @param locale - A target locale - * @param format - A target number format - */ - setNumberFormat: Composition['setNumberFormat']; - /** - * Merge number format - * - * @remarks - * Merge number format to VueI18n instance [numberFormats](legacy#numberFormats). - * - * @param locale - A target locale - * @param format - A target number format - */ - mergeNumberFormat: Composition['mergeNumberFormat']; - /** - * Get choice index - * - * @remarks - * Get pluralization index for current pluralizing number and a given amount of choices. - * - * @deprecated Use `pluralizationRules` option instead of `getChoiceIndex`. - */ - getChoiceIndex: (choice: Choice, choicesLength: number) => number; -} - -/** - * Datetime formatting functions for VueI18n legacy interfaces - * - * @remarks - * This is the interface for {@link VueI18n} - * - * @VueI18nLegacy - */ -export declare interface VueI18nDateTimeFormatting = RemovedIndexResources, C = IsEmptyObject extends false ? PickupFormatPathKeys<{ - [K in keyof DefinedDateTimeFormat]: DefinedDateTimeFormat[K]; -}> : never, M = IsEmptyObject extends false ? PickupFormatKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Datetime formatting - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [i18n component options](injection#i18n) is specified, it’s formatted in preferentially local scope datetime formats than global scope locale messages. - * - * If [i18n component options](injection#i18n) isn't specified, it’s formatted with global scope datetime formats. - * - * @param value - A value, timestamp number or `Date` instance - * - * @returns Formatted value - * - * @VueI18nSee [Datetime formatting](../guide/essentials/datetime) - */ - (value: number | Date): DateTimeFormatResult; - /** - * Datetime formatting - * - * @remarks - * Overloaded `d`. About details, see the [call signature](legacy#value-number-date-datetimeformatresult) details. - * - * @param value - A value, timestamp number or `Date` instance - * @param key - A key of datetime formats - * - * @returns Formatted value - */ - (value: Value, key: Key | ResourceKeys): DateTimeFormatResult; - /** - * Datetime formatting - * - * @remarks - * Overloaded `d`. About details, see the [call signature](legacy#value-number-date-datetimeformatresult) details. - * - * @param value - A value, timestamp number or `Date` instance - * @param key - A key of datetime formats - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Formatted value - */ - (value: Value, key: Key | ResourceKeys, locale: Locales): DateTimeFormatResult; - /** - * Datetime formatting - * - * @remarks - * Overloaded `d`. About details, see the [call signature](legacy#value-number-date-datetimeformatresult) details. - * - * @param value - A value, timestamp number or `Date` instance - * @param args - An argument values - * - * @returns Formatted value - */ - (value: number | Date, args: { - [key: string]: string | boolean | number; - }): DateTimeFormatResult; -} - -/** - * Number formatting functions for VueI18n legacy interfaces - * - * @remarks - * This is the interface for {@link VueI18n} - * - * @VueI18nLegacy - */ -export declare interface VueI18nNumberFormatting = RemovedIndexResources, C = IsEmptyObject extends false ? PickupFormatPathKeys<{ - [K in keyof DefinedNumberFormat]: DefinedNumberFormat[K]; -}> : never, M = IsEmptyObject extends false ? PickupFormatKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Number formatting - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [i18n component options](injection#i18n) is specified, it’s formatted in preferentially local scope number formats than global scope locale messages. - * - * If [i18n component options](injection#i18n) isn't specified, it’s formatted with global scope number formats. - * - * @param value - A number value - * - * @returns Formatted value - * - * @VueI18nSee [Number formatting](../guide/essentials/number) - */ - (value: number): NumberFormatResult; - /** - * Number formatting - * - * @remarks - * Overloaded `n`. About details, see the [call signature](legacy#value-number-numberformatresult) details. - * - * @param value - A number value - * @param key - A key of number formats - * - * @returns Formatted value - */ - (value: number, key: Key | ResourceKeys): NumberFormatResult; - /** - * Number formatting - * - * @remarks - * Overloaded `n`. About details, see the [call signature](legacy#value-number-numberformatresult) details. - * - * @param value - A number value - * @param key - A key of number formats - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Formatted value - */ - (value: number, key: Key | ResourceKeys, locale: Locales): NumberFormatResult; - /** - * Number formatting - * - * @remarks - * Overloaded `n`. About details, see the [call signature](legacy#value-number-numberformatresult) details. - * - * @param value - A number value - * @param args - An argument values - * - * @returns Formatted value - */ - (value: number, args: { - [key: string]: string | boolean | number; - }): NumberFormatResult; -} - -/** - * VueI18n Options - * - * @remarks - * This option is compatible with `VueI18n` class constructor options (offered with Vue I18n v8.x) - * - * @VueI18nLegacy - */ -export declare interface VueI18nOptions = ComposerOptions> { - /** - * @remarks - * The locale of localization. - * - * If the locale contains a territory and a dialect, this locale contains an implicit fallback. - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - * - * @defaultValue `'en-US'` - */ - locale?: Options['locale']; - /** - * @remarks - * The locale of fallback localization. - * - * For more complex fallback definitions see fallback. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue The default `'en-US'` for the `locale` if it's not specified, or it's `locale` value - */ - fallbackLocale?: Options['fallbackLocale']; - /** - * @remarks - * The locale messages of localization. - * - * @VueI18nSee [Getting Started](../guide/) - * - * @defaultValue `{}` - */ - messages?: Options['messages']; - /** - * @remarks - * Allow use flat json messages or not - * - * @defaultValue `false` - */ - flatJson?: Options['flatJson']; - /** - * @remarks - * The datetime formats of localization. - * - * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime) - * - * @defaultValue `{}` - */ - datetimeFormats?: Options['datetimeFormats']; - /** - * @remarks - * The number formats of localization. - * - * @VueI18nSee [Number Formatting](../guide/essentials/number) - * - * @defaultValue `{}` - */ - numberFormats?: Options['numberFormats']; - /** - * @remarks - * The list of available locales in messages in lexical order. - * - * @defaultValue `[]` - */ - availableLocales?: Locale[]; - /** - * @remarks - * Custom Modifiers for linked messages. - * - * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers) - */ - modifiers?: Options['modifiers']; - /** - * @remarks - * The formatter that implemented with Formatter interface. - * - * @deprecated See the [here](../guide/migration/breaking#remove-custom-formatter) - */ - formatter?: Formatter; - /** - * @remarks - * A handler for localization missing. - * - * The handler gets called with the localization target locale, localization path key, the Vue instance and values. - * - * If missing handler is assigned, and occurred localization missing, it's not warned. - * - * @defaultValue `null` - */ - missing?: Options['missing']; - /** - * @remarks - * In the component localization, whether to fall back to root level (global scope) localization when localization fails. - * - * If `false`, it's not fallback to root. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `true` - */ - fallbackRoot?: Options['fallbackRoot']; - /** - * @remarks - * Whether suppress warnings outputted when localization fails. - * - * If `true`, suppress localization fail warnings. - * - * If you use regular expression, you can suppress localization fail warnings that it match with translation key (e.g. `t`). - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `false` - */ - silentTranslationWarn?: Options['missingWarn']; - /** - * @remarks - * Whether do template interpolation on translation keys when your language lacks a translation for a key. - * - * If `true`, skip writing templates for your "base" language; the keys are your templates. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `false` - */ - silentFallbackWarn?: Options['fallbackWarn']; - /** - * @remarks - * Whether suppress warnings when falling back to either `fallbackLocale` or root. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `false` - */ - formatFallbackMessages?: Options['fallbackFormat']; - /** - * @remarks - * Whether `v-t` directive's element should preserve `textContent` after directive is unbinded. - * - * @VueI18nSee [Custom Directive](../guide/advanced/directive) - * @VueI18nSee [Remove `preserveDirectiveContent` option](../guide/migration/breaking#remove-preservedirectivecontent-option) - * - * @defaultValue `false` - * - * @deprecated The `v-t` directive for Vue 3 now preserves the default content. Therefore, this option and its properties have been removed from the VueI18n instance. - */ - preserveDirectiveContent?: boolean; - /** - * @remarks - * Whether to allow the use locale messages of HTML formatting. - * - * See the warnHtmlInMessage property. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value) - * - * @defaultValue `'off'` - */ - warnHtmlInMessage?: WarnHtmlInMessageLevel; - /** - * @remarks - * If `escapeParameterHtml` is configured as true then interpolation parameters are escaped before the message is translated. - * - * This is useful when translation output is used in `v-html` and the translation resource contains html markup (e.g. around a user provided value). - * - * This usage pattern mostly occurs when passing precomputed text strings into UI components. - * - * The escape process involves replacing the following symbols with their respective HTML character entities: `<`, `>`, `"`, `'`. - * - * Setting `escapeParameterHtml` as true should not break existing functionality but provides a safeguard against a subtle type of XSS attack vectors. - * - * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message) - * - * @defaultValue `false` - */ - escapeParameterHtml?: Options['escapeParameter']; - /** - * @remarks - * The shared locale messages of localization for components. More detail see Component based localization. - * - * @VueI18nSee [Shared locale messages for components](../guide/essentials/local#shared-locale-messages-for-components) - * - * @defaultValue `undefined` - */ - sharedMessages?: LocaleMessages; - /** - * @remarks - * A set of rules for word pluralization - * - * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization) - * - * @defaultValue `{}` - */ - pluralizationRules?: Options['pluralRules']; - /** - * @remarks - * A handler for post processing of translation. The handler gets after being called with the `$t`, `t`, `$tc`, and `tc`. - * - * This handler is useful if you want to filter on translated text such as space trimming. - * - * @defaultValue `null` - */ - postTranslation?: Options['postTranslation']; - /** - * @remarks - * Whether synchronize the root level locale to the component localization locale. - * - * If `false`, regardless of the root level locale, localize for each component locale. - * - * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2) - * - * @defaultValue `true` - */ - sync?: boolean; - /** - * @remarks - * A handler for getting notified when component-local instance was created. - * - * The handler gets called with new and old (root) VueI18n instances. - * - * This handler is useful when extending the root VueI18n instance and wanting to also apply those extensions to component-local instance. - * - * @defaultValue `null` - */ - componentInstanceCreatedListener?: ComponentInstanceCreatedListener; - /** - * @remarks - * A message resolver to resolve [`messages`](legacy#messages). - * - * If not specified, the vue-i18n internal message resolver will be used by default. - * - * You need to implement a message resolver yourself that supports the following requirements: - * - * - Resolve the message using the locale message of [`locale`](legacy#locale) passed as the first argument of the message resolver, and the path passed as the second argument. - * - * - If the message could not be resolved, you need to return `null`. - * - * - If you will be returned `null`, the message resolver will also be called on fallback if [`fallbackLocale`](legacy#fallbacklocale-2) is enabled, so the message will need to be resolved as well. - * - * The message resolver is called indirectly by the following APIs: - * - * - [`t`](legacy#t-key) - * - * - [`tc`](legacy#tc-key) - * - * - [`te`](legacy#te-key-locale) - * - * - [`tm`](legacy#tm-key) - * - * - [Translation component](component#translation) - * - * @example - * Here is an example of how to set it up using your `createI18n`: - * ```js - * import { createI18n } from 'vue-i18n' - * - * // your message resolver - * function messageResolver(obj, path) { - * // simple message resolving! - * const msg = obj[path] - * return msg != null ? msg : null - * } - * - * // call with I18n option - * const i18n = createI18n({ - * locale: 'ja', - * messageResolver, // set your message resolver - * messages: { - * en: { ... }, - * ja: { ... } - * } - * }) - * - * // the below your something to do ... - * // ... - * ``` - * - * @VueI18nTip - * :new: v9.2+ - * - * @VueI18nWarning - * If you use the message resolver, the [`flatJson`](legacy#flatjson) setting will be ignored. That is, you need to resolve the flat JSON by yourself. - * - * @VueI18nSee [Fallbacking](../guide/essentials/fallback) - * - * @defaultValue `undefined` - */ - messageResolver?: MessageResolver; -} - -/** - * Resolve locale message translation functions for VueI18n legacy interfaces - * - * @remarks - * This is the interface for {@link VueI18n}. This interfce is an alias of {@link ComposerResolveLocaleMessageTranslation}. - * - * @VueI18nLegacy - */ -export declare type VueI18nResolveLocaleMessageTranslation = ComposerResolveLocaleMessageTranslation; - -/** - * Locale message translation functions for VueI18n legacy interfaces - * - * @remarks - * This is the interface for {@link VueI18n} - * - * @VueI18nLegacy - */ -export declare interface VueI18nTranslation = RemovedIndexResources, C = IsEmptyObject extends false ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]; -}> : never, M = IsEmptyObject extends false ? PickupKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Locale message translation. - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [i18n component options](injection#i18n) is specified, it’s translated in preferentially local scope locale messages than global scope locale messages. - * - * If [i18n component options](injection#i18n) isn't specified, it’s translated with global scope locale messages. - * - * @param key - A target locale message key - * - * @returns Translated message - * - * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope) - */ - (key: Key | ResourceKeys): TranslateResult; - /** - * Locale message translation. - * - * @remarks - * Overloaded `t`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult) details. - * - * @param key - A target locale message key - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Translated message - */ - (key: Key | ResourceKeys, locale: Locales | Locale): TranslateResult; - /** - * Locale message translation. - * - * @remarks - * Overloaded `t`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult) details. - * - * @param key - A target locale message key - * @param locale - A locale, it will be used over than global scope or local scope. - * @param list - A values of list interpolation - * - * @returns Translated message - * - * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation) - */ - (key: Key | ResourceKeys, locale: Locales | Locale, list: unknown[]): TranslateResult; - /** - * Locale message translation. - * - * @remarks - * Overloaded `t`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult) details. - * - * @param key - A target locale message key - * @param locale - A locale, it will be used over than global scope or local scope. - * @param named - A values of named interpolation - * - * @returns Translated message - * - * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation) - */ - (key: Key | ResourceKeys, locale: Locales | Locale, named: Record): TranslateResult; - /** - * Locale message translation. - * - * @remarks - * Overloaded `t`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult) details. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * - * @returns Translated message - * - * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation) - */ - (key: Key | ResourceKeys, list: unknown[]): TranslateResult; - /** - * Locale message translation. - * - * @remarks - * Overloaded `t`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult) details. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * - * @returns Translated message - * - * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation) - */ - (key: Key | ResourceKeys, named: Record): TranslateResult; -} - -/** - * Locale message pluralization functions for VueI18n legacy interfaces - * - * @remarks - * This is the interface for {@link VueI18n} - * - * @VueI18nLegacy - */ -export declare interface VueI18nTranslationChoice = RemovedIndexResources, C = IsEmptyObject extends false ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]; -}> : never, M = IsEmptyObject extends false ? PickupKeys : never, ResourceKeys extends C | M = IsNever extends false ? IsNever extends false ? C | M : C : IsNever extends false ? M : never> { - /** - * Locale message pluralization - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * If [i18n component options](injection#i18n) is specified, it’s pluraled in preferentially local scope locale messages than global scope locale messages. - * - * If [i18n component options](injection#i18n) isn't specified, it’s pluraled with global scope locale messages. - * - * The plural choice number is handled with default `1`. - * - * @param key - A target locale message key - * - * @returns Pluraled message - * - * @VueI18nSee [Pluralization](../guide/essentials/pluralization) - */ - (key: Key | ResourceKeys): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, locale: Locales | Locale): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, list: unknown[]): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, named: Record): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, choice: number): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * @param locale - A locale, it will be used over than global scope or local scope. - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, choice: number, locale: Locales | Locale): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * @param list - A values of list interpolation - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, choice: number, list: unknown[]): TranslateResult; - /** - * Locale message pluralization - * - * @remarks - * Overloaded `tc`. About details, see the [call signature](legacy#key-key-resourcekeys-translateresult-2) details. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * @param named - A values of named interpolation - * - * @returns Pluraled message - */ - (key: Key | ResourceKeys, choice: number, named: Record): TranslateResult; -} - -/** @VueI18nComposition */ -export declare type VueMessageType = string | VNode; - -export declare type WarnHtmlInMessageLevel = 'off' | 'warn' | 'error'; - -export { } - -declare module '@vue/runtime-core' { - /** - * Component Custom Options for Vue I18n - * - * @VueI18nInjection - */ - export interface ComponentCustomOptions { - /** - * VueI18n options - * - * @remarks - * See the {@link VueI18nOptions} - */ - i18n?: VueI18nOptions - /** - * For custom blocks options - * @internal - */ - __i18n?: CustomBlocks - /** - * For devtools - * @internal - */ - __INTLIFY_META__?: string - } - - /** - * Component Custom Properties for Vue I18n - * - * @VueI18nInjection - */ - export interface ComponentCustomProperties { - /** - * Exported Global Composer instance, or global VueI18n instance. - * - * @remarks - * You can get the {@link ExportedGlobalComposer | exported composer instance} which are exported from global {@link Composer | composer instance} created with {@link createI18n}, or global {@link VueI18n | VueI18n instance}. - * You can get the exported composer instance in {@link I18nMode | Composition API mode}, or the Vuei18n instance in {@link I18nMode | Legacy API mode}, which is the instance you can refer to with this property. - * The locales, locale messages, and other resources managed by the instance referenced by this property are valid as global scope. - * If the `i18n` component custom option is not specified, it's the same as the VueI18n instance that can be referenced by the i18n instance {@link I18n.global | global} property. - */ - $i18n: VueI18n | ExportedGlobalComposer - /** - * Locale message translation - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#t | `VueI18n#t`}. - * - * In {@link I18nMode | Composition API mode}, the `$t` is injected by `app.config.globalProperties`. - * the input / output is the same as for Composer, and it work on **global scope**. About that details, see {@link Composer#t | `Composer#t` }. - * - * @param key - A target locale message key - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path - ): TranslateResult - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param locale - A locale, override locale that global scope or local scope - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path - ): TranslateResult - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param locale - A locale, override locale that global scope or local scope - * @param list - A values of list interpolation - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - locale: Locale, - list: unknown[] - ): TranslateResult - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param locale - A locale, override locale that global scope or local scope - * @param named - A values of named interpolation - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - locale: Locale, - named: object - ): TranslateResult - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - list: unknown[] - ): TranslateResult - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - named: Record - ): TranslateResult - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param plural - A choice number of plural - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - plural: number - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param plural - Which plural string to get. 1 returns the first one. - * @param options - An options, see the {@link TranslateOptions} - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - plural: number, - options: TranslateOptions - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param defaultMsg - A default message to return if no translation was found - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - defaultMsg: string - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param defaultMsg - A default message to return if no translation was found - * @param options - An options, see the {@link TranslateOptions} - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - defaultMsg: string, - options: TranslateOptions - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - list: unknown[] - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * @param plural - A choice number of plural - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - list: unknown[], - plural: number - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * @param defaultMsg - A default message to return if no translation was found - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - list: unknown[], - defaultMsg: string - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * @param options - An options, see the {@link TranslateOptions} - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - list: unknown[], - options: TranslateOptions - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - named: NamedValue - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * @param plural - A choice number of plural - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - named: NamedValue, - plural: number - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * @param defaultMsg - A default message to return if no translation was found - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - named: NamedValue, - defaultMsg: string - ): string - /** - * Locale message translation - * - * @remarks - * Overloaded `$t`. About details, see the {@link $t} remarks. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * @param options - An options, see the {@link TranslateOptions} - * - * @returns translation message - */ - $t< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - named: NamedValue, - options: TranslateOptions - ): string - /** - * Resolve locale message translation - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#rt | `VueI18n#rt`}. - * - * In {@link I18nMode | Composition API mode}, the `$rt` is injected by `app.config.globalProperties`. - * the input / output is the same as for Composer, and it work on **global scope**. About that details, see {@link Composer#rt | `Composer#rt` }. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`. - * - * @returns translated message - */ - $rt(message: MessageFunction | VueMessageType): string - /** - * Resolve locale message translation for plurals - * - * @remarks - * Overloaded `$rt`. About details, see the {@link $rt} remarks. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`. - * @param plural - Which plural string to get. 1 returns the first one. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - */ - $rt( - message: MessageFunction | VueMessageType, - plural: number, - options?: TranslateOptions - ): string - /** - * Resolve locale message translation for list interpolations - * - * @remarks - * Overloaded `$rt`. About details, see the {@link $rt} remarks. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`. - * @param list - A values of list interpolation. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - */ - $rt( - message: MessageFunction | VueMessageType, - list: unknown[], - options?: TranslateOptions - ): string - /** - * Resolve locale message translation for named interpolations - * - * @remarks - * Overloaded `$rt`. About details, see the {@link $rt} remarks. - * - * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`. - * @param named - A values of named interpolation. - * @param options - Additional {@link TranslateOptions | options} for translation - * - * @returns Translated message - */ - $rt( - message: MessageFunction | VueMessageType, - named: NamedValue, - options?: TranslateOptions - ): string - /** - * Locale message pluralization - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * The input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#tc | `VueI18n#tc` }. - * The value of plural is handled with default `1`. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path - ): TranslateResult - /** - * Locale message pluralization - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param locale - A locale, override locale that global scope or local scope - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - locale: Locale - ): TranslateResult - /** - * Locale message pluralization - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param list - A values of list interpolation - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - list: unknown[] - ): TranslateResult - /** - * Locale message pluralization - * Supported for Legacy API mode only. - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param named - A values of named interpolation - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - named: Record - ): TranslateResult - /** - * Locale message pluralization - * Supported for Legacy API mode only. - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - choice: number - ): TranslateResult - /** - * Locale message pluralization - * Supported for Legacy API mode only. - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * @param locale - A locale, override locale that global scope or local scope - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - choice: number, - locale: Locale - ): TranslateResult - /** - * Locale message pluralization - * Supported for Legacy API mode only. - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * @param list - A values of list interpolation - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - choice: number, - list: unknown[] - ): TranslateResult - /** - * Locale message pluralization - * Supported for Legacy API mode only. - * - * @remarks - * Overloaded `$tc`. About details, see the {@link $tc} remarks. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param choice - Which plural string to get. 1 returns the first one. - * @param named - A values of named interpolation - * - * @returns translation message that is pluraled - */ - $tc< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - choice: number, - named: Record - ): TranslateResult - /** - * Translation message exist - * - * @remarks - * The input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#te | `VueI18n.#te` }. - * Supported for Legacy API mode only. - * - * @param key - A target locale message key - * @param locale - A locale, optional, override locale that global scope or local scope - * - * @returns if found locale message, `true`, else `false` - */ - $te< - Key extends string, - DefinedLocaleMessage extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupPaths<{ - [K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - key: Key | ResourceKeys | Path, - locale?: Locale - ): boolean - /** - * Datetime formatting - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#d | `VueI18n#d` }. - * - * In {@link I18nMode | Composition API mode}, the `$d` is injected by `app.config.globalProperties`. - * the input / output is the same as for Composer instance, and it work on **global scope**. About that details, see {@link Composer#d | `Composer#d` }. - * - * @param value - A value, timestamp number or `Date` instance - * - * @returns formatted value - */ - $d(value: number | Date): DateTimeFormatResult - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * @param key - A key of datetime formats - * - * @returns formatted value - */ - $d< - Value extends number | Date = number, - Key extends string = string, - DefinedDateTimeFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedDateTimeFormat]: DefinedDateTimeFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: Value, - key: Key | ResourceKeys - ): DateTimeFormatResult - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * @param key - A key of datetime formats - * @param locale - A locale, optional, override locale that global scope or local scope - * - * @returns formatted value - */ - $d< - Value extends number | Date = number, - Key extends string = string, - DefinedDateTimeFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedDateTimeFormat]: DefinedDateTimeFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: Value, - key: Key | ResourceKeys, - locale: Locale - ): DateTimeFormatResult - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * @param args - An argument values - * - * @returns formatted value - */ - $d( - value: number | Date, - args: { [key: string]: string } - ): DateTimeFormatResult - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * - * @returns formatted value - */ - $d(value: number | Date): string - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * @param key - A key of datetime formats - * - * @returns formatted value - */ - $d< - Value extends number | Date = number, - Key extends string = string, - DefinedDateTimeFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedDateTimeFormat]: DefinedDateTimeFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: Value, - key: Key | ResourceKeys - ): string - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * @param key - A key of datetime formats - * @param locale - A locale, optional, override locale that global scope or local scope - * - * @returns formatted value - */ - $d< - Value extends number | Date = number, - Key extends string = string, - DefinedDateTimeFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedDateTimeFormat]: DefinedDateTimeFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: Value, - key: Key | ResourceKeys, - locale: Locale - ): string - /** - * Datetime formatting - * - * @remarks - * Overloaded `$d`. About details, see the {@link $d} remarks. - * - * @param value - A value, timestamp number or `Date` instance - * @param options - An options, see the {@link DateTimeOptions} - * - * @returns formatted value - */ - $d(value: number | Date, options: DateTimeOptions): string - /** - * Number formatting - * - * @remarks - * If this is used in a reactive context, it will re-evaluate once the locale changes. - * - * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#n | `VueI18n.n` }. - * - * In {@link I18nMode | Composition API mode}, the `$n` is injected by `app.config.globalProperties`. - * the input / output is the same as for Composer instance, and it work on **global scope**. About that details, see {@link Composer#n | `Composer.n` }. - * - * @param value - A number value - * - * @returns formatted value - */ - $n(value: number): NumberFormatResult - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param key - A key of number formats - * - * @returns formatted value - */ - $n< - Key extends string = string, - DefinedNumberFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedNumberFormat]: DefinedNumberFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: number, - key: Key | ResourceKeys - ): NumberFormatResult - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param key - A key of number formats - * @param locale - A locale, optional, override locale that global scope or local scope - * - * @returns formatted value - */ - $n< - Key extends string = string, - DefinedNumberFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedNumberFormat]: DefinedNumberFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: number, - key: Key | ResourceKeys, - locale: Locale - ): NumberFormatResult - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param args - An argument values - * - * @returns formatted value - */ - $n( - value: number, - args: { [key: string]: string | boolean | number } - ): NumberFormatResult - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param key - A key of number formats - * @param args - An argument values - * - * @returns formatted value - */ - $n( - value: number, - key: string, - args: { [key: string]: string | boolean | number } - ): NumberFormatResult - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param key - A key of number formats - * @param locale - A locale, optional, override locale that global scope or local scope - * @param args - An argument values - * - * @returns formatted value - */ - $n( - value: number, - key: string, - locale: Locale, - args: { [key: string]: string | boolean | number } - ): NumberFormatResult - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * - * @returns formatted value - */ - $n(value: number): string - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param key - A key of number formats - * - * @returns formatted value - */ - $n< - Key extends string = string, - DefinedNumberFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedNumberFormat]: DefinedNumberFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: number, - key: Key | ResourceKeys - ): string - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param key - A key of number formats - * @param locale - A locale, optional, override locale that global scope or local scope - * - * @returns formatted value - */ - $n< - Key extends string = string, - DefinedNumberFormat extends RemovedIndexResources = RemovedIndexResources, - Keys = IsEmptyObject extends false - ? PickupFormatPathKeys<{ - [K in keyof DefinedNumberFormat]: DefinedNumberFormat[K] - }> - : never, - ResourceKeys extends Keys = IsNever extends false ? Keys : never - >( - value: number, - key: Key | ResourceKeys, - locale: Locale - ): string - /** - * Number formatting - * - * @remarks - * Overloaded `$n`. About details, see the {@link $n} remarks. - * - * @param value - A number value - * @param options - An options, see the {@link NumberOptions} - * - * @returns formatted value - */ - $n(value: number, options: NumberOptions): string - /** - * Locale messages getter - * - * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#tm | `VueI18n#tm` }. - * - * @remarks - * In {@link I18nMode | Composition API mode}, the `$tm` is injected by `app.config.globalProperties`. - * the input / output is the same as for Composer instance, and it work on **global scope**. About that details, see {@link Composer#tm | `Composer.tm` }. - * Based on the current `locale`, locale messages will be returned from Composer instance messages. - * If you change the `locale`, the locale messages returned will also correspond to the locale. - * If there are no locale messages for the given `key` in the composer instance messages, they will be returned with fallbacking. - * - * @param key - A target locale message key - * - * @returns locale messages - */ - $tm< - Key extends string, - Messages extends object = {}, - ResourceKeys extends PickupKeys = PickupKeys - >( - key: Key | ResourceKeys - ): LocaleMessageValue | {} - } -}