chore: 翻译 Position

youngjuning-patch-1
youngjuning 2 years ago
parent 991b049331
commit b93731e684

116
vscode.d.ts vendored

@ -167,14 +167,6 @@ declare module vscode {
*/ */
lineAt(position: Position): TextLine; lineAt(position: Position): TextLine;
/**
* Converts the position to a zero-based offset.
*
* The position will be {@link TextDocument.validatePosition adjusted}.
*
* @param position A position.
* @return A valid zero-based offset.
*/
/** /**
* 0 * 0
* *
@ -241,126 +233,109 @@ declare module vscode {
export class Position { export class Position {
/** /**
* The zero-based line value. *
*/ */
readonly line: number; readonly line: number;
/** /**
* The zero-based character value. *
*/ */
readonly character: number; readonly character: number;
/** /**
* @param line A zero-based line value. * @param line
* @param character A zero-based character value. * @param character
*/ */
constructor(line: number, character: number); constructor(line: number, character: number);
/** /**
* Check if this position is before `other`. * `other`
* *
* @param other A position. * @param other
* @return `true` if position is on a smaller line * @return `true`
* or on the same line on a smaller character.
*/ */
isBefore(other: Position): boolean; isBefore(other: Position): boolean;
/** /**
* Check if this position is before or equal to `other`. * `other`
* *
* @param other A position. * @param other
* @return `true` if position is on a smaller line * @return `true`
* or on the same line on a smaller or equal character.
*/ */
isBeforeOrEqual(other: Position): boolean; isBeforeOrEqual(other: Position): boolean;
/** /**
* Check if this position is after `other`. * other
* *
* @param other A position. * @param other
* @return `true` if position is on a greater line * @return `true`
* or on the same line on a greater character.
*/ */
isAfter(other: Position): boolean; isAfter(other: Position): boolean;
/** /**
* Check if this position is after or equal to `other`. * other
* *
* @param other A position. * @param other
* @return `true` if position is on a greater line * @return true
* or on the same line on a greater or equal character.
*/ */
isAfterOrEqual(other: Position): boolean; isAfterOrEqual(other: Position): boolean;
/** /**
* Check if this position is equal to `other`. * other
* * @param other
* @param other A position. * @return true
* @return `true` if the line and character of the given position are equal to
* the line and character of this position.
*/ */
isEqual(other: Position): boolean; isEqual(other: Position): boolean;
/** /**
* Compare this to `other`. * `other`
* *
* @param other A position. * @param other
* @return A number smaller than zero if this position is before the given position, * @return
* a number greater than zero if this position is after the given position, or zero when
* this and the given position are equal.
*/ */
compareTo(other: Position): number; compareTo(other: Position): number;
/** /**
* Create a new position relative to this position. *
* *
* @param lineDelta Delta value for the line value, default is `0`. * @param lineDelta line value `0`
* @param characterDelta Delta value for the character value, default is `0`. * @param characterDelta character value `0`
* @return A position which line and character is the sum of the current line and * @return
* character and the corresponding deltas.
*/ */
translate(lineDelta?: number, characterDelta?: number): Position; translate(lineDelta?: number, characterDelta?: number): Position;
/** /**
* Derived a new position relative to this position. *
* *
* @param change An object that describes a delta to this position. * @param change
* @return A position that reflects the given delta. Will return `this` position if the change * @return `this`
* is not changing anything.
*/ */
translate(change: { lineDelta?: number; characterDelta?: number; }): Position; translate(change: { lineDelta?: number; characterDelta?: number; }): Position;
/** /**
* Create a new position derived from this position. *
* *
* @param line Value that should be used as line value, default is the {@link Position.line existing value} * @param line 使 {@link Position.line existing value}
* @param character Value that should be used as character value, default is the {@link Position.character existing value} * @param character 使 {@link Position.character existing value}
* @return A position where line and character are replaced by the given values. * @return
*/ */
with(line?: number, character?: number): Position; with(line?: number, character?: number): Position;
/** /**
* Derived a new position from this position. *
* *
* @param change An object that describes a change to this position. * @param change
* @return A position that reflects the given change. Will return `this` position if the change * @return `this`
* is not changing anything.
*/ */
with(change: { line?: number; character?: number; }): Position; with(change: { line?: number; character?: number; }): Position;
} }
/**
* A range represents an ordered pair of two positions.
* It is guaranteed that {@link Range.start start}.isBeforeOrEqual({@link Range.end end})
*
* Range objects are __immutable__. Use the {@link Range.with with},
* {@link Range.intersection intersection}, or {@link Range.union union} methods
* to derive new ranges from an existing range.
*/
/** /**
* *
* *
* 使 {@link Range.with with} {@link Range.intersection intersection}{@link Range.union union} * 使 {@link Range.with with} {@link Range.intersection intersection}{@link Range.union union}
*
* @maintainer {@link https://youngjuning.js.org @youngjuning}
*/ */
export class Range { export class Range {
@ -14429,17 +14404,16 @@ declare module vscode {
} }
/** /**
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise, * Thenable ES6 promisesQjquery.DeferredWinJS.Promise
* and others. This API makes no assumption about what promise library is being used which * API 使 promise promise
* enables reusing existing code without migrating to a specific promise implementation. Still, * 使 promises
* we recommend the use of native promises which are available in this editor.
*/ */
interface Thenable<T> { interface Thenable<T> {
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Promise /
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled Promise reslove
* @param onrejected The callback to execute when the Promise is rejected. * @param onrejected Promise reject
* @returns A Promise for the completion of which ever callback is executed. * @returns Promise
*/ */
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>; then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>; then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;

Loading…
Cancel
Save