-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from rubensworks/fix/ts
Migrate typings to @rdfjs/types
- Loading branch information
Showing
3 changed files
with
221 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,48 @@ | ||
import * as RDF from "rdf-js"; | ||
|
||
declare module "hdt" { | ||
export interface SearchTermsOpts { | ||
limit?: number; | ||
position?: "subject" | "predicate" | "object"; | ||
prefix?: string; | ||
subject?: string; // mutually exclusive with prefix and prioritized | ||
object?: string, // mutually exclusive with prefix and prioritized | ||
} | ||
|
||
export interface SearchLiteralsOpts { | ||
limit?: number; | ||
offset?: number; | ||
} | ||
|
||
export interface SearchLiteralsResult { | ||
literals: RDF.Literal[]; | ||
totalCount: number; | ||
} | ||
|
||
export interface SearchTriplesOpts { | ||
limit?: number; | ||
offset?: number; | ||
} | ||
|
||
export interface SearchResult { | ||
triples: RDF.Quad[]; | ||
totalCount: number; | ||
hasExactCount: boolean; | ||
} | ||
|
||
export interface Document { | ||
searchTriples(sub?: RDF.Term, pred?: RDF.Term, obj?: RDF.Term, opts?: SearchTriplesOpts): Promise<SearchResult>; | ||
countTriples(sub?: RDF.Term, pred?: RDF.Term, obj?: RDF.Term): Promise<SearchResult>; | ||
searchLiterals(substring: string, opts?: SearchLiteralsOpts): Promise<SearchLiteralsResult>; | ||
searchTerms(opts?: SearchTermsOpts): Promise<string[]>; | ||
close(): Promise<void>; | ||
readHeader(): Promise<string>; | ||
changeHeader(triples:string, outputFile:string): Promise<Document>; | ||
} | ||
|
||
export function fromFile(filename: string, opts?: { dataFactory?: RDF.DataFactory }): Promise<Document>; | ||
import * as RDF from "@rdfjs/types"; | ||
|
||
export interface SearchTermsOpts { | ||
limit?: number; | ||
position?: "subject" | "predicate" | "object"; | ||
prefix?: string; | ||
subject?: string; // mutually exclusive with prefix and prioritized | ||
object?: string, // mutually exclusive with prefix and prioritized | ||
} | ||
|
||
export interface SearchLiteralsOpts { | ||
limit?: number; | ||
offset?: number; | ||
} | ||
|
||
export interface SearchLiteralsResult { | ||
literals: RDF.Literal[]; | ||
totalCount: number; | ||
} | ||
|
||
export interface SearchTriplesOpts { | ||
limit?: number; | ||
offset?: number; | ||
} | ||
|
||
export interface SearchResult { | ||
triples: RDF.Quad[]; | ||
totalCount: number; | ||
hasExactCount: boolean; | ||
} | ||
|
||
export interface Document { | ||
searchTriples(sub?: RDF.Term, pred?: RDF.Term, obj?: RDF.Term, opts?: SearchTriplesOpts): Promise<SearchResult>; | ||
|
||
countTriples(sub?: RDF.Term, pred?: RDF.Term, obj?: RDF.Term): Promise<SearchResult>; | ||
|
||
searchLiterals(substring: string, opts?: SearchLiteralsOpts): Promise<SearchLiteralsResult>; | ||
|
||
searchTerms(opts?: SearchTermsOpts): Promise<string[]>; | ||
|
||
close(): Promise<void>; | ||
|
||
readHeader(): Promise<string>; | ||
|
||
changeHeader(triples: string, outputFile: string): Promise<Document>; | ||
} | ||
|
||
export function fromFile(filename: string, opts?: { dataFactory?: RDF.DataFactory }): Promise<Document>; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters