UNPKG

repository-provider

Version:

abstract interface to git repository providers like github, bitbucket and gitlab

72 lines (71 loc) 2.02 kB
/** * @typedef {import('./repository.mjs').Repository} Repository */ /** * Base for Branch and Tag */ export class Ref extends OwnedObject { /** * Attributes * @type {Object} */ static get attributes(): any; static get attributeMapping(): { protected: string; }; get refType(): string; /** * Full ref path. * @return {string} git ref of the Ref */ get ref(): string; /** * Get sha of our ref. * @return {Promise<string>} sha of the ref */ get refId(): Promise<string>; /** * List entries of the branch. * @param {string[]|string} [matchingPatterns] * @return {AsyncGenerator<ContentEntry>} all matching entries in the branch */ entries(matchingPatterns?: string[] | string): AsyncGenerator<ContentEntry>; /** * Get exactly one matching entry by name or undefine if no such entry is found. * @param {string} name * @return {Promise<ContentEntry|undefined>} */ maybeEntry(name: string): Promise<ContentEntry | undefined>; /** * Get exactly one matching entry by name (throws if entry is not found). * @param {string} name * @return {Promise<ContentEntry>} */ entry(name: string): Promise<ContentEntry>; /** * Ref owner. * By default we provide the repository owner * @see {@link Repository#owner} * @return {Repository} */ get repository(): Repository; get identifier(): any; /** * * @return false */ get isProtected(): boolean; /** * Are we the default ref. * @return {boolean} false */ get isDefault(): boolean; /** * List all entries of the branch. * @return {AsyncGenerator<ContentEntry>} all entries in the branch */ [Symbol.asyncIterator](): AsyncGenerator<ContentEntry>; } export type Repository = import("./repository.mjs").Repository; import { OwnedObject } from "./owned-object.mjs"; import { ContentEntry } from "content-entry";