Home / File/ common.ts — astro Source File

common.ts — astro Source File

Architecture documentation for common.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 3 imports 5 functions

Entity Profile

Dependency Diagram

graph LR
  669e29cb_6284_b440_c979_7aeecf0609ce["common.ts"]
  aa7ecf5d_ecc0_6ab7_c8df_09c64e200c44["../../type-utils.js"]
  669e29cb_6284_b440_c979_7aeecf0609ce --> aa7ecf5d_ecc0_6ab7_c8df_09c64e200c44
  28857b9f_4720_3f29_4abb_a7eec34dcca5["../types/public/context.js"]
  669e29cb_6284_b440_c979_7aeecf0609ce --> 28857b9f_4720_3f29_4abb_a7eec34dcca5
  0302dbcf_dad6_6bb1_3d2f_5c90fa9a96d4["shiki"]
  669e29cb_6284_b440_c979_7aeecf0609ce --> 0302dbcf_dad6_6bb1_3d2f_5c90fa9a96d4
  style 669e29cb_6284_b440_c979_7aeecf0609ce fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { BundledLanguage, LanguageRegistration, SpecialLanguage } from 'shiki';
import type { OmitIndexSignature, Simplify } from '../../type-utils.js';
import type { APIContext } from './context.js';

/**
 * getStaticPaths() options
 *
 * [Astro Reference](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
 */
export interface GetStaticPathsOptions {
	paginate: PaginateFunction;
	routePattern: string;
}

export type GetStaticPathsItem = {
	params: Params;
	props?: Props;
};
export type GetStaticPathsResult = GetStaticPathsItem[];
export type GetStaticPathsResultKeyed = GetStaticPathsResult & {
	keyed: Map<string, GetStaticPathsItem>;
};

/**
 * Return an array of pages to generate for a [dynamic route](https://docs.astro.build/en/guides/routing/#dynamic-routes). (**SSG Only**)
 *
 * [Astro Reference](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
 */
export type GetStaticPaths = (
	options: GetStaticPathsOptions,
) => Promise<GetStaticPathsResult> | GetStaticPathsResult;

/**
 * paginate() Options
 *
 * [Astro reference](https://docs.astro.build/en/reference/routing-reference/#paginate)
 */
export interface PaginateOptions<PaginateProps extends Props, PaginateParams extends Params> {
	/** the number of items per-page (default: `10`) */
	pageSize?: number;
	/** key: value object of page params (ex: `{ tag: 'javascript' }`) */
	params?: PaginateParams;
	/** object of props to forward to `page` result */
	props?: PaginateProps;
}

/**
 * Represents a single page of data in a paginated collection
 *
 * [Astro reference](https://docs.astro.build/en/reference/routing-reference/#the-pagination-page-prop)
 */
export interface Page<T = any> {
	/** result */
	data: T[];
	/** metadata */
	/** the count of the first item on the page, starting from 0 */
	start: number;
	/** the count of the last item on the page, starting from 0 */
	end: number;
	/** total number of results */
// ... (127 more lines)

Domain

Subdomains

Dependencies

  • ../../type-utils.js
  • ../types/public/context.js
  • shiki

Frequently Asked Questions

What does common.ts do?
common.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in common.ts?
common.ts defines 5 function(s): context, data, options, opts, rewritePayload.
What does common.ts depend on?
common.ts imports 3 module(s): ../../type-utils.js, ../types/public/context.js, shiki.
Where is common.ts in the architecture?
common.ts is located at packages/astro/src/types/public/common.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/types/public).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free