Skip to content

Commit

Permalink
Fix: make all option properties optional
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored and webketje committed Nov 25, 2024
1 parent b5b8059 commit 0498f4d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ export type CollectionConfig = {
/**
* - One or more glob patterns to match files to a collection
*/
pattern: string | string[];
pattern?: string | string[] | null;
/**
* - A key to sort by (e.g. `date`,`title`, ..) or a custom sort function
*/
sortBy: string | ((a: any, b: any) => 0 | 1 | -1);
sortBy?: string | ((a: any, b: any) => 0 | 1 | -1);
/**
* - Limit the amount of items in a collection to `limit`
*/
limit: number;
limit?: number;
/**
* - Adds `next` and `previous` keys to file metadata of matched files
*/
refer: boolean;
refer?: boolean;
/**
* - Whether to invert the sorting function results (asc/descending)
*/
reverse: boolean;
reverse?: boolean;
/**
* - A function that gets a `Metalsmith.File` as first argument and returns `true` for every file to include in the collection
*/
filterBy: Function;
filterBy?: Function;
/**
* - An object with metadata to attach to the collection, or a `json`/`yaml`filepath string to load data from (relative to `Metalsmith.directory`)
*/
metadata: any | string;
metadata?: any | string | null;
};
/**
* Add `collections` of files to the global metadata as a sorted array.
Expand Down

0 comments on commit 0498f4d

Please sign in to comment.