Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmatteomanf committed Apr 21, 2024
1 parent fb4312d commit 3728889
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changeset/healthy-buttons-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@itsmatteomanf/astro-security-txt": minor
"@itsmatteomanf/astro-pagefind": minor
---

Fix Types
13 changes: 13 additions & 0 deletions packages/astro-pagefind/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
/// <reference types="astro/client" />

type PagefindOptions = {
index?: {
rootSelector?: string | undefined;
excludeSelectors?: string[] | undefined;
forceLanguage?: string | undefined;
keepIndexUrl?: boolean | undefined;
verbose?: boolean | undefined;
logfile?: string | undefined;
} | undefined;
directories?: string[] | undefined;
site?: string | undefined;
} | undefined;
8 changes: 3 additions & 5 deletions packages/astro-pagefind/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import type { AstroIntegration } from "astro";
import { createIndex } from "pagefind";
import { ZodError, z } from "zod";
import { name } from "../package.json";
import { PagefindOptions, validateOptions } from "./libs/validate-options";
import { PagefindOptions as ZodTypes, validateOptions } from "./libs/validate-options";

type Options = z.infer<typeof PagefindOptions>;

export const integration = (options: Options): AstroIntegration => {
export const integration = (options: PagefindOptions): AstroIntegration => {
let generate = true;
let validatedOptions: Options;
let validatedOptions: z.infer<typeof ZodTypes>;

return {
name,
Expand Down
12 changes: 12 additions & 0 deletions packages/astro-security-txt/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
/// <reference types="astro/client" />

type SecurityTxtOptions = {
contact: string | string[]
expires?: Date | undefined
encryption?: string | string[] | undefined
acknowledgements?: string | string[] | undefined
preferredLanguages?: string | string[] | undefined
canonical?: string | string[] | undefined
policy?: string | string[] | undefined
hiring?: string | string[] | undefined
csaf?: string | string[] | undefined
};
8 changes: 3 additions & 5 deletions packages/astro-security-txt/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import type { AstroConfig, AstroIntegration } from "astro";
import { mkdirSync, writeFileSync } from "node:fs";
import { ZodError, z } from "zod";
import { name } from "../package.json";
import { SecurityTxtOptions, validateOptions } from "./libs/validate-options";
import { SecurityTxtOptions as ZodTypes, validateOptions } from "./libs/validate-options";

type Options = z.infer<typeof SecurityTxtOptions>;

export const integration = (options: Options): AstroIntegration => {
export const integration = (options: SecurityTxtOptions): AstroIntegration => {
let config: AstroConfig;
let generate = true;
let validatedOptions: Options;
let validatedOptions: z.infer<typeof ZodTypes>;

return {
name,
Expand Down

0 comments on commit 3728889

Please sign in to comment.