Skip to content

Commit

Permalink
chore: updated array type usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Jan 25, 2024
1 parent 283960f commit 1419400
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion next-data/generators/releaseData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getNodeReleaseStatus = (now, support) => {
* This method is used to generate the Node.js Release Data
* for self-consumption during RSC and Static Builds
*
* @returns {Promise<import('../../types').NodeRelease[]>}
* @returns {Promise<Array<import('../../types').NodeRelease>>}
*/
const generateReleaseData = () => {
return nodevu({ fetch: fetch }).then(nodevuOutput => {
Expand Down
2 changes: 1 addition & 1 deletion next-data/generators/websiteFeeds.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const generateWebsiteFeeds = ({ posts }) => {
/**
* This generates all the Website RSS Feeds that are used for the website
*
* @type {[string, Feed][]}
* @type {Array<[string, Feed]>}
*/
const websiteFeeds = siteConfig.rssFeeds.map(
({ category, title, description, file }) => {
Expand Down
6 changes: 6 additions & 0 deletions next.calendar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import {
SHARED_CALENDAR_KEY,
} from './next.calendar.constants.mjs';

/**
*
* @param {string} calendarId
* @param {number} maxResults
* @returns {Promise<Array<import('./types').CalendarEvent>>}
*/
export const getCalendarEvents = async (calendarId = '', maxResults = 20) => {
const currentDate = new Date();
const nextWeekDate = new Date();
Expand Down
2 changes: 1 addition & 1 deletion next.dynamic.constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { defaultLocale } from './next.locales.mjs';
* This is a list of all static routes or pages from the Website that we do not
* want to allow to be statically built on our Static Export Build.
*
* @type {((route: import('./types').RouteSegment) => boolean)[]} A list of Ignored Routes by Regular Expressions
* @type {Array<((route: import('./types').RouteSegment) => boolean)>} A list of Ignored Routes by Regular Expressions
*/
export const IGNORED_ROUTES = [
// This is used to ignore all blog routes except for the English language
Expand Down
2 changes: 1 addition & 1 deletion next.dynamic.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const getDynamicRouter = async () => {
* This method returns a list of all routes that exist for a given locale
*
* @param {string} locale
* @returns {string[]}
* @returns {Array<string>}
*/
const getRoutesByLanguage = async (locale = defaultLocale.code) => {
const shouldIgnoreStaticRoute = pathname =>
Expand Down
6 changes: 3 additions & 3 deletions next.helpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getMatchingRoutes = (route = '', matches = []) =>
*
* @param {string} root the root directory to search from
* @param {string} cwd the current working directory
* @returns {Promise<string[]>} a promise containing an array of directories
* @returns {Promise<Array<string>>} a promise containing an array of directories
*/
export const getDirectories = async (root, cwd) => {
return glob('*', { root, cwd, withFileTypes: true })
Expand All @@ -46,8 +46,8 @@ export const getRelativePath = path => fileURLToPath(new URL('.', path));
*
* @param {string} root the root directory to search from
* @param {string} cwd the given locale code
* @param {string[]} ignore an array of glob patterns to ignore
* @returns {Promise<string[]>} a promise containing an array of paths
* @param {Array<string>} ignore an array of glob patterns to ignore
* @returns {Promise<Array<string>>} a promise containing an array of paths
*/
export const getMarkdownFiles = async (root, cwd, ignore = []) => {
const cacheKey = `${root}${cwd}${ignore.join('')}`;
Expand Down
2 changes: 1 addition & 1 deletion next.json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import _siteConfig from './site.json' assert { type: 'json' };
/** @type {import('./types').SiteNavigation} */
export const siteNavigation = _siteNavigation;

/** @type {Record<string, import('./types').Redirect[]>} */
/** @type {Record<string, Array<import('./types').Redirect>>} */
export const siteRedirects = _siteRedirects;

/** @type {import('./types').SiteConfig} */
Expand Down
2 changes: 1 addition & 1 deletion next.mdx.compiler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const reactRuntime = { Fragment, jsx, jsxs };
* @param {'md' | 'mdx'} fileExtension
* @returns {Promise<{
* MDXContent: import('mdx/types').MDXContent;
* headings: import('@vcarl/remark-headings').Heading[];
* headings: Array<import('@vcarl/remark-headings').Heading>;
* frontmatter: Record<string, any>;
* readingTime: import('reading-time').ReadTimeResults;
* }>}
Expand Down
4 changes: 2 additions & 2 deletions next.mdx.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import rehypeShikiji from './next.mdx.shiki.mjs';
/**
* Provides all our Rehype Plugins that are used within MDX
*
* @type {import('unified').Plugin[]}
* @type {Array<import('unified').Plugin>}
*/
export const NEXT_REHYPE_PLUGINS = [
// Generates `id` attributes for headings (H1, ...)
Expand All @@ -29,6 +29,6 @@ export const NEXT_REHYPE_PLUGINS = [
/**
* Provides all our Remark Plugins that are used within MDX
*
* @type {import('unified').Plugin[]}
* @type {Array<import('unified').Plugin>}
*/
export const NEXT_REMARK_PLUGINS = [remarkGfm, remarkHeadings, readingTime];
4 changes: 2 additions & 2 deletions next.mdx.shiki.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ function getMetaParameter(meta, key) {
/**
* @typedef {import('unist').Node} Node
* @property {string} tagName
* @property {Node[]} children
* @property {Array<import('unist').Node>} children
*/

/**
* Checks if the given node is a valid code element.
*
* @param {Node} node - The node to be verified.
* @param {import('unist').Node} node - The node to be verified.
*
* @return {boolean} - True when it is a valid code element, false otherwise.
*/
Expand Down
2 changes: 1 addition & 1 deletion shiki.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import shellSessionLanguage from 'shikiji/langs/shellsession.mjs';
import typeScriptLanguage from 'shikiji/langs/typescript.mjs';
import shikiNordTheme from 'shikiji/themes/nord.mjs';

/** @type {import('shikiji').LanguageRegistration[]} */
/** @type {Array<import('shikiji').LanguageRegistration>} */
export const LANGUAGES = [
{
...javaScriptLanguage[0],
Expand Down

0 comments on commit 1419400

Please sign in to comment.