Skip to content

Commit

Permalink
Merge pull request #2029 from protobufjs/protobufEditionsWork
Browse files Browse the repository at this point in the history
feat: add feature resolution for protobuf editions
  • Loading branch information
sofisl authored Oct 16, 2024
2 parents 19e1fef + 23c8ab9 commit 547afa2
Show file tree
Hide file tree
Showing 15 changed files with 926 additions and 11,802 deletions.
870 changes: 86 additions & 784 deletions cli/package-lock.json

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,21 @@ export class Enum extends ReflectionObject {
/** Values options, if any */
public valuesOptions?: { [k: string]: { [k: string]: any } };

/** Resolved values features, if any */
public _valuesFeatures?: { [k: string]: { [k: string]: any } };

/** Unresolved values features, if any */
public _valuesProtoFeatures?: { [k: string]: { [k: string]: any } };

/** Reserved ranges, if any. */
public reserved: (number[]|string)[];

/**
* Resolves value features
* @returns `this`
*/
public resolve(): Enum;

/**
* Constructs an enum from an enum descriptor.
* @param name Enum name
Expand Down Expand Up @@ -877,6 +889,12 @@ export abstract class ReflectionObject {
/** Unique name within its namespace. */
public name: string;

/** Resolved Features. */
public _features: any;

/** Unresolved Features. */
public _protoFeatures: any;

/** Parent namespace. */
public parent: (Namespace|null);

Expand Down Expand Up @@ -919,6 +937,9 @@ export abstract class ReflectionObject {
*/
public resolve(): ReflectionObject;

/** Resolves child features from parent features */
public _resolveFeatures(): void;

/**
* Gets an option value.
* @param name Option name
Expand Down Expand Up @@ -1255,7 +1276,7 @@ export class Root extends NamespaceBase {

/**
* Loads a namespace descriptor into a root namespace.
* @param json Nameespace descriptor
* @param json Namespace descriptor
* @param [root] Root namespace, defaults to create a new one if omitted
* @returns Root namespace
*/
Expand Down Expand Up @@ -2194,9 +2215,10 @@ export namespace util {
* @param dst Destination object
* @param path dot '.' delimited path of the property to set
* @param value the value to set
* @param overWrite whether or not to concatenate the values into an array or overwrite; defaults to false.
* @returns Destination object
*/
function setProperty(dst: { [k: string]: any }, path: string, value: object): { [k: string]: any };
function setProperty(dst: { [k: string]: any }, path: string, value: object, overWrite: boolean): { [k: string]: any };

/** Decorator root (TypeScript). */
let decorateRoot: Root;
Expand Down
Loading

0 comments on commit 547afa2

Please sign in to comment.