Fix guidelines and license types on SimpleIcon TS interface (#8581)

This commit is contained in:
Álvaro Mondéjar 2023-04-28 17:22:57 +02:00 committed by GitHub
parent ef90d9c2ee
commit 4631c15a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 26 deletions

21
sdk.d.ts vendored
View File

@ -3,6 +3,8 @@
* Types for Simple Icons SDK. * Types for Simple Icons SDK.
*/ */
import type { License } from './types.d.ts';
/** /**
* The data for a third-party extension. * The data for a third-party extension.
* *
@ -21,25 +23,6 @@ type ThirdPartyExtensionSubject = {
url: string; url: string;
}; };
/**
* The license for a Simple Icon.
*
* Corresponds to the `license` property in the *_data/simple-icons.json* file.
*
* @see {@link https://github.com/simple-icons/simple-icons/blob/develop/CONTRIBUTING.md#optional-data Optional Data}
*/
export type License = SPDXLicense | CustomLicense;
type SPDXLicense = {
type: string;
url?: string;
};
type CustomLicense = {
type: 'custom';
url: string;
};
/** /**
* The aliases for a Simple Icon. * The aliases for a Simple Icon.
* *

29
types.d.ts vendored
View File

@ -1,3 +1,23 @@
/**
* The license for a Simple Icon.
*
* @see {@link https://github.com/simple-icons/simple-icons/blob/develop/CONTRIBUTING.md#optional-data Optional Data}
*/
export type License = SPDXLicense | CustomLicense;
type SPDXLicense = {
type: string;
url?: string;
};
type CustomLicense = {
type: 'custom';
url: string;
};
/**
* The data for a Simple Icon as is exported by the npm package.
*/
export interface SimpleIcon { export interface SimpleIcon {
title: string; title: string;
slug: string; slug: string;
@ -5,11 +25,6 @@ export interface SimpleIcon {
path: string; path: string;
source: string; source: string;
hex: string; hex: string;
guidelines?: string | undefined; guidelines: string | undefined;
license?: license: License | undefined;
| {
type: string;
url: string;
}
| undefined;
} }