@earth-app/shovel
Version:
Kotlin Multiplatform Web Scraping Framework
82 lines • 4.36 kB
TypeScript
type Nullable<T> = T | null | undefined
declare function KtSingleton<T>(): T & (abstract new() => any);
export declare namespace kotlin.collections {
interface KtList<E> /* extends kotlin.collections.Collection<E> */ {
asJsReadonlyArrayView(): ReadonlyArray<E>;
readonly __doNotUseOrImplementIt: {
readonly "kotlin.collections.KtList": unique symbol;
};
}
namespace KtList {
function fromJsArray<E>(array: ReadonlyArray<E>): kotlin.collections.KtList<E>;
}
interface KtMap<K, V> {
asJsReadonlyMapView(): ReadonlyMap<K, V>;
readonly __doNotUseOrImplementIt: {
readonly "kotlin.collections.KtMap": unique symbol;
};
}
namespace KtMap {
function fromJsMap<K, V>(map: ReadonlyMap<K, V>): kotlin.collections.KtMap<K, V>;
}
}
export declare namespace io.ktor.client.engine.js {
/** @deprecated */
const initHook: any;
}
export declare namespace com.earthapp.shovel {
function closeClient(): void;
function clearCache(): void;
class Element {
private constructor();
get tagName(): string;
get innerHTML(): string;
get outerHTML(): string;
get textContent(): string;
get ownTextContent(): string;
get attributes(): kotlin.collections.KtMap<string, string>;
get children(): kotlin.collections.KtList<com.earthapp.shovel.Element>;
get(attribute: string): Nullable<string>;
get id(): Nullable<string>;
get classes(): kotlin.collections.KtList<string>;
get style(): Nullable<string>;
}
namespace Element {
/** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
namespace $metadata$ {
const constructor: abstract new () => Element;
}
}
class Document {
private constructor();
get url(): string;
get html(): string;
get body(): com.earthapp.shovel.Element;
get bodyElements(): string;
get head(): com.earthapp.shovel.Element;
get title(): string;
get metadata(): kotlin.collections.KtMap<string, kotlin.collections.KtList<string>>;
get linkTags(): kotlin.collections.KtMap<string, kotlin.collections.KtList<string>>;
}
namespace Document {
/** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
namespace $metadata$ {
const constructor: abstract new () => Document;
}
}
function documentQuerySelector(_this_: com.earthapp.shovel.Document, selector: string, filter?: (p0: com.earthapp.shovel.Element) => boolean): Nullable<com.earthapp.shovel.Element>;
function documentGetElementById(_this_: com.earthapp.shovel.Document, id: string): Nullable<com.earthapp.shovel.Element>;
function documentGetElementsByClassName(_this_: com.earthapp.shovel.Document, className: string): kotlin.collections.KtList<com.earthapp.shovel.Element>;
function documentInputValue(_this_: com.earthapp.shovel.Document, name: string): Nullable<string>;
function elementQuerySelector(_this_: com.earthapp.shovel.Element, selector: string, filter?: (p0: com.earthapp.shovel.Element) => boolean): Nullable<com.earthapp.shovel.Element>;
function elementGetElementById(_this_: com.earthapp.shovel.Element, id: string): Nullable<com.earthapp.shovel.Element>;
function elementGetElementsByClassName(_this_: com.earthapp.shovel.Element, className: string): kotlin.collections.KtList<com.earthapp.shovel.Element>;
function elementInputValue(_this_: com.earthapp.shovel.Element, name: string): Nullable<string>;
}
export declare namespace com.earthapp.shovel {
function documentQuerySelectorAll(_this_: com.earthapp.shovel.Document, selector: string): kotlin.collections.KtList<com.earthapp.shovel.Element>;
function elementQuerySelectorAll(_this_: com.earthapp.shovel.Element, selector: string): kotlin.collections.KtList<com.earthapp.shovel.Element>;
}
export declare function fetchDocumentAsPromise(_this_: string): Promise<com.earthapp.shovel.Document>;
export declare function fetchAsPromise(url: string): Promise<com.earthapp.shovel.Document>;
export as namespace com_earth_app_shovel_shovel;