1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00
simple-icons/sdk.d.ts

87 lines
2.6 KiB
TypeScript
Raw Normal View History

2023-04-19 15:23:13 +02:00
/**
* @fileoverview
* Types for Simple Icons SDK.
*/
2024-03-24 19:38:18 +02:00
import type {CustomLicense, SPDXLicense} from './types';
2023-04-19 15:23:13 +02:00
/**
* The data for a third-party extension.
*
* Includes the module and author of the extension,
* both including a name and URL.
*
* @see {@link https://github.com/simple-icons/simple-icons#third-party-extensions Third-Party Extensions}
*/
export type ThirdPartyExtension = {
module: ThirdPartyExtensionSubject;
author: ThirdPartyExtensionSubject;
};
type ThirdPartyExtensionSubject = {
name: string;
url: string;
};
/**
* The aliases for a Simple Icon.
*
* Corresponds to the `aliases` property in the *_data/simple-icons.json* file.
*
* @see {@link https://github.com/simple-icons/simple-icons/blob/develop/CONTRIBUTING.md#aliases Aliases}
*/
export type Aliases = {
aka?: string[];
dup?: DuplicateAlias[];
2024-03-24 19:38:18 +02:00
loc?: Record<string, string>;
2023-04-19 15:23:13 +02:00
};
type DuplicateAlias = {
title: string;
hex?: string;
guidelines?: string;
2024-03-24 19:38:18 +02:00
loc?: Record<string, string>;
2023-04-19 15:23:13 +02:00
};
/**
* The data for a Simple Icon.
*
* Corresponds to the data stored for each icon in the *_data/simple-icons.json* file.
*
* @see {@link https://github.com/mondeja/simple-icons/blob/utils-entrypoint/CONTRIBUTING.md#7-update-the-json-data-for-simpleiconsorg Update the JSON Data for SimpleIcons.org}
*/
export type IconData = {
title: string;
hex: string;
source: string;
slug?: string;
guidelines?: string;
2024-01-12 16:59:15 +02:00
license?: Omit<SPDXLicense, 'url'> | CustomLicense;
2023-04-19 15:23:13 +02:00
aliases?: Aliases;
};
/* The next code is autogenerated from sdk.mjs */
/* eslint-disable */
2023-04-19 15:23:13 +02:00
2024-03-31 09:54:08 +02:00
export const SVG_PATH_REGEX: RegExp;
2023-04-19 15:23:13 +02:00
export function getDirnameFromImportMeta(importMetaUrl: string): string;
export function urlRegex(jsonschemaPath?: string): Promise<RegExp>;
2023-04-19 15:23:13 +02:00
export function getIconSlug(icon: IconData): string;
export function svgToPath(svg: string): string;
export function titleToSlug(title: string): string;
export function slugToVariableName(slug: string): string;
export function titleToHtmlFriendly(brandTitle: string): string;
export function htmlFriendlyToTitle(htmlFriendlyTitle: string): string;
2024-03-24 19:38:18 +02:00
export function getIconDataPath(rootDirectory?: string): string;
export function getIconsDataString(rootDirectory?: string): string;
export function getIconsData(rootDirectory?: string): IconData[];
2023-04-19 15:23:13 +02:00
export function normalizeNewlines(text: string): string;
export function normalizeColor(text: string): string;
export function getThirdPartyExtensions(
readmePath?: string,
): Promise<ThirdPartyExtension[]>;
export function getThirdPartyLibraries(
readmePath?: string,
): Promise<ThirdPartyExtension[]>;
2023-04-19 15:23:13 +02:00
export const collator: Intl.Collator;