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

Loading…
Cancel
Save