full site update
This commit is contained in:
34
node_modules/astro/dist/content/mutable-data-store.d.ts
generated
vendored
34
node_modules/astro/dist/content/mutable-data-store.d.ts
generated
vendored
@@ -1,10 +1,10 @@
|
||||
import { type PathLike } from 'node:fs';
|
||||
import { type DataEntry, DataStore, type RenderedContent } from './data-store.js';
|
||||
import { type DataEntry, ImmutableDataStore } from './data-store.js';
|
||||
/**
|
||||
* Extends the DataStore with the ability to change entries and write them to disk.
|
||||
* This is kept as a separate class to avoid needing node builtins at runtime, when read-only access is all that is needed.
|
||||
*/
|
||||
export declare class MutableDataStore extends DataStore {
|
||||
export declare class MutableDataStore extends ImmutableDataStore {
|
||||
#private;
|
||||
set(collectionName: string, key: string, value: unknown): void;
|
||||
delete(collectionName: string, key: string): void;
|
||||
@@ -15,13 +15,18 @@ export declare class MutableDataStore extends DataStore {
|
||||
addModuleImport(fileName: string): void;
|
||||
writeAssetImports(filePath: PathLike): Promise<void>;
|
||||
writeModuleImports(filePath: PathLike): Promise<void>;
|
||||
scopedStore(collectionName: string): ScopedDataStore;
|
||||
scopedStore(collectionName: string): DataStore;
|
||||
/**
|
||||
* Returns a MetaStore for a given collection, or if no collection is provided, the default meta collection.
|
||||
*/
|
||||
metaStore(collectionName?: string): MetaStore;
|
||||
/**
|
||||
* Returns a promise that resolves when all pending saves are complete.
|
||||
* This includes any in-progress debounced saves for the data store, asset imports, and module imports.
|
||||
*/
|
||||
waitUntilSaveComplete(): Promise<void>;
|
||||
toString(): string;
|
||||
writeToDisk(filePath: PathLike): Promise<void>;
|
||||
writeToDisk(): Promise<void>;
|
||||
/**
|
||||
* Attempts to load a MutableDataStore from the virtual module.
|
||||
* This only works in Vite.
|
||||
@@ -31,27 +36,10 @@ export declare class MutableDataStore extends DataStore {
|
||||
static fromString(data: string): Promise<MutableDataStore>;
|
||||
static fromFile(filePath: string | URL): Promise<MutableDataStore>;
|
||||
}
|
||||
export interface ScopedDataStore {
|
||||
export interface DataStore {
|
||||
get: <TData extends Record<string, unknown> = Record<string, unknown>>(key: string) => DataEntry<TData> | undefined;
|
||||
entries: () => Array<[id: string, DataEntry]>;
|
||||
set: <TData extends Record<string, unknown>>(opts: {
|
||||
/** The ID of the entry. Must be unique per collection. */
|
||||
id: string;
|
||||
/** The data to store. */
|
||||
data: TData;
|
||||
/** The raw body of the content, if applicable. */
|
||||
body?: string;
|
||||
/** The file path of the content, if applicable. Relative to the site root. */
|
||||
filePath?: string;
|
||||
/** A content digest, to check if the content has changed. */
|
||||
digest?: number | string;
|
||||
/** The rendered content, if applicable. */
|
||||
rendered?: RenderedContent;
|
||||
/**
|
||||
* If an entry is a deferred, its rendering phase is delegated to a virtual module during the runtime phase.
|
||||
*/
|
||||
deferredRender?: boolean;
|
||||
}) => boolean;
|
||||
set: <TData extends Record<string, unknown>>(opts: DataEntry<TData>) => boolean;
|
||||
values: () => Array<DataEntry>;
|
||||
keys: () => Array<string>;
|
||||
delete: (key: string) => void;
|
||||
|
Reference in New Issue
Block a user