All files / types ICallbackTypedefParameter.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34                                                                   
/**
 * One parameter of an ADR-029 callback typedef, as both the `.c` and the `.h`
 * need to see it.
 *
 * The two files used to format this from separate data: the header was handed
 * only `{ type, isStruct }`, so it dropped `const` and array dimensions and
 * declared a typedef the implementation contradicted (#1164).
 */
interface ICallbackTypedefParameter {
  readonly type: string;
  readonly isStruct: boolean;
  /**
   * ADR-045: the parameter was written `string<N>`, so it renders as `char*`
   * and takes a `const` the plain-parameter branch does not.
   *
   * Carried as a flag rather than baked into `type` because `const` belongs to
   * the parameter, not to the type name -- the same reason `isStruct` is a flag
   * and not a `*` glued onto the string.
   */
  readonly isString?: boolean;
  /**
   * ADR-030: the parameter is an opaque handle, so it is `T*` in C and C++
   * alike -- never an ADR-006 reference -- and for an array each element is
   * (#996). The prototype's `T*` comes from the same decision.
   */
  readonly isOpaqueHandle?: boolean;
  readonly isConst?: boolean;
  readonly isArray?: boolean;
  readonly arrayDims?: string;
  readonly name?: string;
}
 
export default ICallbackTypedefParameter;