Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export FileChild class #2523

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

YaoKaiLun
Copy link
Contributor

Try to do something like below:

  const children: FileChild[] = [];

  for (const node of nodes) {
    if (Element.isElement(node)) {
      const child = convertComponent(node);
      children.push(child);
    }
  }

  const doc = new Document({
    sections: [
      {
        properties: {},
        children,
      },
    ],
  });

Now i have to do like below:

import { ISectionOptions } from 'docx';

const sectionOptionsInstance: ISectionOptions = {
  children: [],
};

type FileChild = typeof sectionOptionsInstance['children'][number];

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6b8e223) 100.00% compared to head (bd5fec2) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2523   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          280       280           
  Lines        14021     14021           
  Branches      1369      1369           
=========================================
  Hits         14021     14021           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@YaoKaiLun
Copy link
Contributor Author

@dolanmiu please review my PR

@dolanmiu dolanmiu merged commit 022b25c into dolanmiu:master Jan 25, 2024
8 checks passed
@YaoKaiLun
Copy link
Contributor Author

@dolanmiu Could you publish a new npm version 🙏?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants