remove an export default

breaks typedoc for some reason
This commit is contained in:
cswimr 2025-02-09 09:59:56 -06:00
parent fa518bc41f
commit eab42ee1b8
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
3 changed files with 53 additions and 6 deletions

View file

@ -1,5 +1,5 @@
import * as toml from "toml";
import Resource from "./resource";
import { Resource } from "./resource";
import {
UrlProvider,
ModrinthProvider,
@ -155,7 +155,7 @@ export class Packwiz {
/**
* Parses a packwiz.toml file and returns its contents.
*
* @param indexFilePath - The path of the TOML file.
* @param filePath - The path of the TOML file.
* @returns The parsed file as a structured class.
*/
export async function parsePackwiz(filePath: string): Promise<Packwiz> {

View file

@ -1,15 +1,36 @@
import Resource from "./resource";
import { Resource } from "./resource";
import { HashFormat } from "./enums/hash-format";
/**
* Provides a base class for URL-based providers.
*/
export class UrlProvider {
/**
* Creates a new UrlProvider instance.
* @param hash - A hash string used for identifying or verifying the resource.
* @param hashFormat - The format of the provided hash.
* @param url - A Resource instance representing the URL.
*/
constructor(
public hash: string,
public hashFormat: HashFormat,
public url: Resource,
) {}
) { }
}
/**
* URL provider for handling Modrinth-related URLs.
* Extends the UrlProvider with Modrinth-specific properties.
*/
export class ModrinthProvider extends UrlProvider {
/**
* Creates a new ModrinthProvider instance.
* @param hash - A hash string used for identification or verification.
* @param hashFormat - The format of the provided hash.
* @param url - A Resource instance representing the URL.
* @param modId - The identifier for the Modrinth mod.
* @param versionId - The version identifier for the mod.
*/
constructor(
hash: string,
hashFormat: HashFormat,
@ -21,7 +42,21 @@ export class ModrinthProvider extends UrlProvider {
}
}
/**
* URL provider for handling GitHub-related URLs.
* Extends the UrlProvider with GitHub-specific properties.
*/
export class GitHubProvider extends UrlProvider {
/**
* Creates a new GitHubProvider instance.
* @param hash - A hash string used for identification or verification.
* @param hashFormat - The format of the hash.
* @param url - A Resource instance representing the URL.
* @param branch - The branch name within the GitHub repository.
* @param regex - A regular expression for matching specific patterns in the GitHub URL.
* @param slug - A URL slug used for identifying the repository.
* @param tag - The tag associated with the GitHub resource.
*/
constructor(
hash: string,
hashFormat: HashFormat,
@ -35,7 +70,19 @@ export class GitHubProvider extends UrlProvider {
}
}
/**
* URL provider for handling CurseForge-related URLs.
* Extends the UrlProvider with CurseForge-specific properties.
*/
export class CurseForgeProvider extends UrlProvider {
/**
* Creates a new CurseForgeProvider instance.
* @param hash - A hash string used for identification or verification.
* @param hashFormat - The format of the provided hash.
* @param mode - The mode indicating how the CurseForge file should be accessed.
* @param fileId - The identifier for the file on CurseForge.
* @param projectId - The identifier for the project on CurseForge.
*/
constructor(
hash: string,
hashFormat: HashFormat,

View file

@ -2,8 +2,8 @@ import * as fs from "fs/promises";
import { URL } from "url";
import * as path from "path";
export default class Resource {
constructor(public readonly path: string) {}
export class Resource {
constructor(public readonly path: string) { }
toString(): string {
return this.path;